• PHP Video Tutorials

PHP - Function fetch object



Syntax

object odbc_fetch_object ( resource $result [, int $rownumber ] )

Definition and Usage

It used to fetch a result as an object

Return Values

It returns an object or else send a message as there is no more rows

Parameters

Sr.No Parameters & Description
1

result

It contains result resources from odbc_exec()

2

rownumber

we can choose optionally that which number of row to retrive

Examples

Try out 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); 
?>
php_function_reference.htm
Advertisements