php - sqlsrv fetch array is only returning 1 result (most recent) and i know there is 5+ for a particular code -


here query, it's pulling added holdcode. armcode patient id , holdcode 2 digit code.

$test = sql::query("select armcode, holdcode are.aas.me armcode = 'adsmanzs01'", $row['holdcode']); if($test){   $data = sqlsrv_fetch_array($test);   echo $data['holdcode']; }  

do need foreach or loop through results have them echo or print_r?

as usual, appreciated.

use while loop iterate results

  while ($data = sqlsrv_fetch_array($test);) {       //perform task   } 

Popular posts from this blog

Php - Delimiter must not be alphanumeric or backslash -

c# - How to change the "Applies To" field under folder auditing options programatically (.NET) -

c++ - Ambiguity when using boost::assign::list_of to construct a std::vector -