db_fetch_object

5 database.mysqli.inc db_fetch_object($result)
5 database.pgsql.inc db_fetch_object($result)
5 database.mysql.inc db_fetch_object($result)
6 database.mysqli.inc db_fetch_object($result)
6 database.mysql.inc db_fetch_object($result)
6 database.pgsql.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()

File

includes/database.mysql.inc, line 149
Database interface code for MySQL database servers.

Code

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

Comments

Drupal 7

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

Login or register to post comments