odbc_fetch_object

object odbc_fetch_object(resource result, [int row]) 

Fetches a row of data as an object.

Returns:

Object containing current record or FALSE

Description:

Reads the current row in the ODBC result set and returns an object with each element containing the value of the corresponding field and each key containing the field name.

Warning:

This function is only available if you have compiled PHP with DBMaker support. DBMaker is available from www.dbmaker.com.

Version:

Existing since version 4.0

Example:

Display query results
$db = odbc_connect("simdb","SYSADM",""); 
$sql = "SELECT * from t1"; 
$result = odbc_exec($db, $sql); 
while ($row = odbc_fetch_object($result)) {
   echo $row->c1, "\n"; 
} 

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.