Avatar of butterhook
butterhook
Flag for United Kingdom of Great Britain and Northern Ireland

asked on 

PHP ODBC result set as array of name->value pairs

Hello

Is there a class or set of functions that will allow me to run a query and return an array of arrays wih field names as keys

i.e. in almost pseudo-code in the code section?

thanks




$dbobj = new specialODBCobj($connectioninfo);
 
$resultset = $dbobj->query($sqlquery);
 
foreach($resultset as $individualresult) {
 
   $myaddress = $individualresult['address'];
   // as opposed to $individualresult[0]
 
   $myphone = $individualresult['phone'];
   // as opposed to $individualresult[1]
 
}

Open in new window

PHP

Avatar of undefined
Last Comment
butterhook

8/22/2022 - Mon