Same name in this branch
- 4.6.x includes/database.pgsql.inc \db_result()
- 4.6.x includes/database.mysql.inc \db_result()
Same name and namespace in other branches
- 4.7.x includes/database.pgsql.inc \db_result()
- 4.7.x includes/database.mysqli.inc \db_result()
- 4.7.x includes/database.mysql.inc \db_result()
- 5.x includes/database.pgsql.inc \db_result()
- 5.x includes/database.mysqli.inc \db_result()
- 5.x includes/database.mysql.inc \db_result()
- 6.x includes/database.pgsql.inc \db_result()
- 6.x includes/database.mysqli.inc \db_result()
- 6.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().
$row: The index of the row whose result is needed.
Return value
The resulting field.
Related topics
32 calls to db_result()
- book_admin_save in modules/
book.module - comment_moderate in modules/
comment.module - comment_num_all in modules/
comment.module - comment_num_new in modules/
comment.module - get number of new comments for current user and specified node
- comment_num_replies in modules/
comment.module
File
- includes/
database.mysql.inc, line 128 - Database interface code for MySQL database servers.
Code
function db_result($result, $row = 0) {
if ($result && mysql_num_rows($result) > $row) {
return mysql_result($result, $row);
}
}