Same name in this branch
  1. 6.x includes/database.pgsql.inc \db_result()
  2. 6.x includes/database.mysqli.inc \db_result()
  3. 6.x includes/database.mysql.inc \db_result()
Same name and namespace in other branches
  1. 4.6.x includes/database.pgsql.inc \db_result()
  2. 4.6.x includes/database.mysql.inc \db_result()
  3. 4.7.x includes/database.pgsql.inc \db_result()
  4. 4.7.x includes/database.mysqli.inc \db_result()
  5. 4.7.x includes/database.mysql.inc \db_result()
  6. 5.x includes/database.pgsql.inc \db_result()
  7. 5.x includes/database.mysqli.inc \db_result()
  8. 5.x includes/database.mysql.inc \db_result()

Return an individual result field from the previous query.

Only use this function if exactly one field is being selected; otherwise, use db_fetch_object() or db_fetch_array().

Parameters

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

Return value

The resulting field or FALSE.

Related topics

79 calls to db_result()
actions_function_lookup in includes/actions.inc
Given an md5 hash of a function name, return the function name.
comment_multiple_delete_confirm in modules/comment/comment.admin.inc
List the selected comments and verify that the admin really wants to delete them.
comment_num_all in modules/comment/comment.module
Get comment count for a node.
comment_num_new in modules/comment/comment.module
Get number of new comments for current user and specified node.
comment_num_replies in modules/comment/comment.module
Get replies count for a comment.

... See full list

File

includes/database.pgsql.inc, line 206
Database interface code for PostgreSQL database servers.

Code

function db_result($result) {
  if ($result && pg_num_rows($result) > 0) {
    $array = pg_fetch_row($result);
    return $array[0];
  }
  return FALSE;
}