You are here

function db_fetch_object in Drupal 6

Same name in this branch
  1. 6 includes/database.mysqli.inc \db_fetch_object()
  2. 6 includes/database.mysql.inc \db_fetch_object()
  3. 6 includes/database.pgsql.inc \db_fetch_object()
Same name and namespace in other branches
  1. 4 includes/database.mysqli.inc \db_fetch_object()
  2. 4 includes/database.mysql.inc \db_fetch_object()
  3. 4 includes/database.pgsql.inc \db_fetch_object()
  4. 5 includes/database.mysqli.inc \db_fetch_object()
  5. 5 includes/database.mysql.inc \db_fetch_object()
  6. 5 includes/database.pgsql.inc \db_fetch_object()

Fetch one result row from the previous query as an object.

Parameters

$result: A database query result resource, as returned from db_query().

Return value

An object representing the next row of the result, or FALSE. The attributes of this object are the table fields selected by the query.

Related topics

180 calls to db_fetch_object()
actions_do in includes/actions.inc
Perform a given list of actions by executing their callback functions.
actions_get_all_actions in includes/actions.inc
Retrieves all action instances from the database.
actions_load in includes/actions.inc
Retrieve a single action from the database.
actions_synchronize in includes/actions.inc
Synchronize actions that are provided by modules.
aggregator_block in modules/aggregator/aggregator.module
Implementation of hook_block().

... See full list

File

includes/database.mysqli.inc, line 148
Database interface code for MySQL database servers using the mysqli client libraries. mysqli is included in PHP 5 by default and allows developers to use the advanced features of MySQL 4.1.x, 5.0.x and beyond.

Code

function db_fetch_object($result) {
  if ($result) {
    $object = mysqli_fetch_object($result);
    return isset($object) ? $object : FALSE;
  }
}