db_result

Versions
4.6 – 5
db_result($result, $row = 0)
6
db_result($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

▾ 53 functions call db_result()

aggregator_block in modules/aggregator.module
Implementation of hook_block().
book_admin_save in modules/book.module
comment_moderate in modules/comment.module
comment_nodeapi in modules/comment.module
Implementation of hook_nodeapi().
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
comment_post in modules/comment.module
comment_render in modules/comment.module
comment_validate_form in modules/comment.module
db_next_id in includes/database.pgsql.inc
Return a new unique ID in the given sequence.
drupal_get_filename in includes/bootstrap.inc
Returns and optionally sets the filename for a system item (module, theme, etc.). The filename, whether provided, cached, or retrieved from the database, is only returned if the file exists.
fileupload_file_download in developer/examples/fileupload.module
fileupload_update in developer/examples/fileupload.module
filter_format_allowcache in modules/filter.module
Check if text in a certain input format is allowed to be cached.
forum_validate in modules/forum.module
Implementation of hook_validate().
locale_admin_string in modules/locale.module
Page handler for the string search and administration screen
menu_reset_item in modules/menu.module
Menu callback; reset a single modified item.
node_access in modules/node.module
Determine whether the current user may perform the given operation on the specified node.
node_access_view_all_nodes in modules/node.module
Determine whether the user has a global viewing grant for all nodes.
node_admin_nodes in modules/node.module
Generate the content administration overview.
node_comment_mode in modules/node.module
Retrieve the comment mode for the given node ID (none, read, or read/write).
node_page in modules/node.module
Menu callback; dispatches control to the appropriate operation handler.
node_search in modules/node.module
Implementation of hook_search().
pager_query in includes/pager.inc
Perform a paged database query.
path_nodeapi in modules/path.module
Implementation of hook_nodeapi().
path_save in modules/path.module
Verify that a new URL alias is valid, and save it to the database.
path_set_alias in modules/path.module
Set an aliased path for a given Drupal path, preventing duplicates.
poll_block in modules/poll.module
Implementation of hook_block().
profile_admin_add in modules/profile.module
Menu callback; adds a new field to all user profiles.
queue_count in modules/queue.module
queue_score in modules/queue.module
search_cron in modules/search.module
Implementation of hook_cron().
throttle_exit in modules/throttle.module
Implementation of hook_exit().
update_101 in database/updates.inc
update_124 in database/updates.inc
update_37 in database/updates.inc
update_40 in database/updates.inc
update_47 in database/updates.inc
update_52 in database/updates.inc
update_63 in database/updates.inc
update_68 in database/updates.inc
update_80 in database/updates.inc
update_85 in database/updates.inc
upload_count_size in modules/upload.module
user_get_authname in modules/user.module
Called by authentication modules in order to edit/view their authmap information.
user_save in modules/user.module
Save changes to a user account.
user_validate_authmap in modules/user.module
_comment_update_node_statistics in modules/comment.module
Updates the comment statistics for a given node. This should be called any time a comment is added, deleted, or updated.
_forum_get_vid in modules/forum.module
Returns the vocabulary id for forum navigation.
_forum_new in modules/forum.module
Finds the first unread node for a given forum.
_forum_topics_read in modules/forum.module
_user_authenticated_id in modules/user.module

Code

includes/database.pgsql.inc, line 124

<?php
function db_result($result, $row = 0) {
  if ($result && pg_num_rows($result) > $row) {
    $res = pg_fetch_row($result, $row);

    return $res[0];
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.