MySQL_FETCH_OBJECT
(PHP 3, PHP 4) mysql_fetch_object - obtain a line from the result set as an object
Description Object
MySQL_FETCH_OBJECT (Resource Result)
Returns the object generated according to the obtained line, if there is no more row, return false.
MySQL_FETCH_OBJECT () and mysql_fetch_array () are similar, only one difference - returns an object rather than an array. Indirect also means accessing arrays by field name instead of offset (number is a legal attribute name).
Note: The field name returned by this function is case sensitive.
php / * this is valid * / echo $ row-> field; / * this is invalid * / echo $ row-> 0;?>
On the speed, this function is like mysql_fetch_array (), almost as fast as mysql_fetch_row ().
Example 1. MYSQL_FETCH_Object () example
?