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 }