title: How to iterate on a row returned in PHP sql and store each value in a different variable
body: <p>I have a fuction that returns a row of values as below</p>
  
  <pre><code> fldClientID    fldPetID    fldName    fldBreed             fldType   fldInactive
  &gt; 1406          114        Lola         Poodle - Toy          Dog           0 
    1406          5786       Izadora      Chihuahua long hair   Dog           0 
    1406          8728       Kurmo        Maltese Mix           Dog           0
  </code></pre>
  
  <p>The pet id is different on each pet but same client id I need a method to iterate through the return resurtset and store each pet in a variable like</p>
  
  <pre><code>PETNAME1= lola      PETBREED1= Poodle-To
  PETNAME2= Izadora   PETBREED2 =chihuahua long hair
  </code></pre>
  
  <p>I have tried this code but stores only the first pet all way through</p>
  
  <pre><code>  $pets=$this-&gt;readPet();
  
     While(next($pets))
       {
           $petname1=$pets['fldName'];
           $petbreed1=$pets['fldBreed'];
  
          $petname2=$pets['fldName'];
          $petbreed2=$pets['fldBreed'];
       }
  </code></pre>