English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The odbc_fetch_object() function retrieves the result row as an object.
object odbc_fetch_object ( resource $result[, int $rownumber] )
It is used to obtain the result as an object.
It returns an object or sends a message because there are no more rows.
Number | Parameters and descriptions |
---|---|
1 | result It contains the result resource from odbc_exec() |
2 | rownumber We can choose the number of rows to retrieve |
Try the following example
<?php $input_ID = odbc_connect($db_name, $username, $password) or die(odbc_error_msg()); $sql = "SELECT * FROM TABLE"; $result = odbc_exec($input_ID, $sql); while ($rows = odbc_fetch_object($result)) { print $rows->COLUMNNAME; } odbc_close($input_ID); ?>