How do you save ALL ROWS of ODBC result to array in PHP? -


i can't seem find way save rows odbc_exec array. found php_fetch_array, fetches 1 row @ time, requiring me iterate through rows put array. there more concise way this?

tried

` $myarray = array(); while (odbc_fetch_row($result)) {    $myarray[odbc_result($result,1)] = odbc_result($result,2);  }` 

and

 ` $myarray = array(); while ($myrow = odbc_fetch_row($result)) {  $myarray[$myrow['id']] = $myrow['name'];  }` 

but $myarray still empty.


Comments