mysql_fetch_object(result)

Description: Fetches one row of data from the resultset associated with the identifier result as an object.

Each call to mysql_fetch_object() fetches the next row of data from the resultset as an object, making the data accessible by their column names but not numerically. When there are no more rows, it returns FALSE.

Example:

while ($row = mysql_fetch_object ($result)) {
    echo "$row->lastname, $row->firstname, $row->date_of_birth<BR>\n";
}

See also: mysql_fetch_array(), mysql_fetch_row()

Get Sams Teach Yourself MySQL in 21 Days, Second Edition 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.