function db_result in Drupal 6
Same name in this branch
- 6 includes/database.mysqli.inc \db_result()
- 6 includes/database.mysql.inc \db_result()
- 6 includes/database.pgsql.inc \db_result()
Same name and namespace in other branches
- 4 includes/database.mysqli.inc \db_result()
- 4 includes/database.mysql.inc \db_result()
- 4 includes/database.pgsql.inc \db_result()
- 5 includes/database.mysqli.inc \db_result()
- 5 includes/database.mysql.inc \db_result()
- 5 includes/database.pgsql.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
116 calls to db_result()
- actions_function_lookup in includes/
actions.inc - Given an md5 hash of a function name, return the function name.
- aggregator_block in modules/
aggregator/ aggregator.module - Implementation of hook_block().
- block_add_block_form_validate in modules/
block/ block.admin.inc - block_admin_configure_validate in modules/
block/ block.admin.inc - block_flush_caches in modules/
block/ block.module - Implementation of hook_flush_caches().
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;
}