title: How do you save rows to an array and print out in PHP using ODBC?
body: <p>I have the following:</p>
  
  <pre><code>while($myRow = odbc_fetch_array( $result )){ &lt;--lots of rows
      $thisResult['name'] = $myRow["name"] ;
      $thisResult['race'] = $myRow["race"] ;
      $thisResult['sex'] = $myRow["sex"];
      $thisResult['dob'] = $myRow["dob"];
  }
  </code></pre>
  
  <p>I can't figure out how to print this back out. </p>
  
  <p>I want to get each row and iterate through each row in the array like a datareader.  I'm not sure what to do.  I do not want to do the echo in the while.  I need to be able to print it out elsewhere.  But I don't think I've done it right here to be able to print it later.</p>
  
  <p>I also tried, this, however:</p>
  
  <pre><code>while($myRow = odbc_fetch_array( $result )){ &lt;--lots of rows
       print($thisResult[$myRow["name"]] = $myRow);
  }
  </code></pre>
  
  <p>I then tried:</p>
  
  <pre><code>while($myRow = odbc_fetch_array( $result )){ &lt;--lots of rows
      print (odbc_result($myRow,"name"));
  }
  </code></pre>
  
  <p>but got an error.</p>
  
  <p>Thank you for any help.</p>
  
  <p>EDIT:  when I do this:</p>
  
  <pre><code>while($myRow = odbc_fetch_array( $result )){
      print ($myRow["name"]);
  }
  </code></pre>
  
  <p>I get undefined index name.  I am mainly concerned with saving to an array but I have to be able to do it in the loop first.</p>