Home > PHP > Function > MySQL > mysql_fetch_object()

mysql_fetch_object()

mysql_fetch_object - Fetch a result row as an object

Syntax

object mysql_fetch_object (resource $result, string $class_name, array $params)

Arguments

  • result - The result resource that is being evaluated. This result comes from a call to mysql_query().
  • class_name - The name of the class to instantiate, set the properties of and return. If not specified, a stdClassobject is returned.
  • params - An optional array of parameters to pass to the constructor for class_name objects.

Description

Returns an object with properties that correspond to the fetched row and moves the internal data pointer ahead.

Version

PHP 4, 5

Return value

Returns an object with string properties that correspond to the fetched row, or FALSE if there are no more rows.