function db_fetch_object

You are here

4.6 database.pgsql.inc db_fetch_object($result)
4.6 database.mysql.inc db_fetch_object($result)
4.7 database.pgsql.inc db_fetch_object($result)
4.7 database.mysqli.inc db_fetch_object($result)
4.7 database.mysql.inc db_fetch_object($result)
5 database.pgsql.inc db_fetch_object($result)
5 database.mysqli.inc db_fetch_object($result)
5 database.mysql.inc db_fetch_object($result)
6 database.pgsql.inc db_fetch_object($result)
6 database.mysqli.inc db_fetch_object($result)
6 database.mysql.inc db_fetch_object($result)

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

183 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.pgsql.inc, line 173
Database interface code for PostgreSQL database servers.

Code

function db_fetch_object($result) {
  if ($result) {
    return pg_fetch_object($result);
  }
}

Comments

see also db_fetch_array()

In Drupal 7, this is no longer used. See http://drupal.org/update/modules/6/7#dbtng

Example in Drupal 7:

<?php
db_query
('SELECT n.moderate FROM {node} n WHERE n.nid = :nid', array(':nid' => $node->nid))->fetch();
?>

See: http://drupal.org/update/modules/6/7#dbtng