db_result

Хочешь помочь с переводом? Это очень просто и быстро. Лишь зарегистрируйся, и можешь тут же начать переводить.

includes/database.mysql.inc, строка 236

Версии
5
db_result($result, $row = 0)
6
db_result($result)

Возвращает одиночное поле результата из предыдущего запроса.

Используйте эту функцию, для получения результата запроса с единичным полем (например SELECT nid FROM... или SELECT COUNT(*) FROM...), иначе используйте db_fetch_object() или db_fetch_array().

Параметры

$result Ресурс результата запроса к базе данных, который возвращает db_query().

$row Индекс строки результата, которую требуется получить.

Возвращаемое значение

Поле результата или FALSE.

Связанные темы

▾ 67 функции вызывают db_result()

aggregator_block in modules/aggregator/aggregator.module
Реализация hook_block().
comment_multiple_delete_confirm in modules/comment/comment.module
List the selected comments and verify that the admin really wants to delete them.
comment_nodeapi in modules/comment/comment.module
Реализация hook_nodeapi().
comment_num_all in modules/comment/comment.module
Возвращает число комментариев к ноде.
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
comment_save in modules/comment/comment.module
Сохраняет новый или измененный комментарий.
comment_validate in modules/comment/comment.module
Проверка данных комментария.
db_check_setup in includes/database.pgsql.inc
Проверяет, корректно ли настроена база данных.
db_next_id in includes/database.mysql.inc
Возвращает новый уникальный ID для данной таблицы.
do_search in modules/search/search.module
Do a query on the full-text search index for a word or words.
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.
drupal_is_denied in includes/bootstrap.inc
Perform an access check for a given mask and rule type. Rules are usually created via admin/user/rules page.
drupal_lookup_path in includes/path.inc
Для указанного синонима пути возвращается системный URL Drupal, если он существует. Для указанного системного URL Drupal возвращается синоним пути, если он существует. В остальных случаях возвращается FALSE.
fileupload_file_download in developer/examples/fileupload.module
Implementation of hook_file_download.
fileupload_update in developer/examples/fileupload.module
Implementation of hook_update().
filter_admin_format_form_submit in modules/filter/filter.module
Process filter format form submissions.
filter_format_allowcache in modules/filter/filter.module
Check if text in a certain input format is allowed to be cached.
filter_list_format in modules/filter/filter.module
Возвращает список форматов ввода для выбранного формата.
forum_submit in modules/forum/forum.module
Implementation of hook_submit().
forum_validate in modules/forum/forum.module
Implementation of hook_validate().
hook_file_download in developer/hooks/core.php
Позволяет загружать файлы.
hook_search in developer/hooks/core.php
Определяет пользовательскую функцию поиска.
install_verify_drupal in ./install.php
Verify if Drupal is installed.
menu_reset_item in modules/menu/menu.module
Menu callback; reset a single modified item.
multipage_form_example_custom_submit in developer/examples/multipage_form_example.module
node_access in modules/node/node.module
Устанавливает может ли текущий пользователь выполнять заданные действия на определённом ноде.
node_access_view_all_nodes in modules/node/node.module
Determine whether the user has a global viewing grant for all nodes.
node_comment_mode in modules/node/node.module
Retrieve the comment mode for the given node ID (none, read, or read/write).
node_configure in modules/node/node.module
Menu callback; presents general node configuration options.
node_menu in modules/node/node.module
Реализация hook_menu().
node_multiple_delete_confirm in modules/node/node.module
node_page_default in modules/node/node.module
Menu callback; Generate a listing of promoted nodes.
node_revision_delete in modules/node/node.module
Delete the revision with specified revision number. A 'delete revision' nodeapi event is invoked when a revision is deleted.
node_revision_delete_confirm_submit in modules/node/node.module
node_search in modules/node/node.module
Implementation of hook_search().
node_update_index in modules/node/node.module
Реализация hook_update_index().
pager_query in includes/pager.inc
Выполняет «постраничный» запрос к базе данных.
path_form_alter in modules/path/path.module
Implementation of hook_form_alter().
path_form_validate in modules/path/path.module
Verify that a new URL alias is valid
path_nodeapi in modules/path/path.module
Implementation of hook_nodeapi().
path_set_alias in modules/path/path.module
Set an aliased path for a given Drupal path, preventing duplicates.
poll_block in modules/poll/poll.module
Реализация hook_block().
profile_autocomplete in modules/profile/profile.module
Callback to allow autocomplete of profile text fields.
profile_field_form_validate in modules/profile/profile.module
Validate profile_field_form submissions.
search_update_totals in modules/search/search.module
This function is called on shutdown to ensure that search_total is always up to date (even if cron times out or otherwise fails).
sess_count in includes/session.inc
Количество пользователей, которые имеют сессии. Можно рассчитывать для анонимов или аутентифицированных сессий.
system_install in modules/system/system.install
Реализация hook_install().
system_update_124 in modules/system/system.install
system_update_169 in modules/system/system.install
system_update_172 in modules/system/system.install
system_update_178 in modules/system/system.install
Update base paths for relative URLs in node and comment content.
system_update_179 in modules/system/system.install
Update base paths for relative URLs in custom blocks, profiles and various variables.
upload_delete_revision in modules/upload/upload.module
upload_save in modules/upload/upload.module
upload_space_used in modules/upload/upload.module
Determine how much disk space is occupied by a user's uploaded files.
upload_total_space_used in modules/upload/upload.module
Determine how much disk space is occupied by uploaded files.
user_admin_role_validate in modules/user/user.module
user_multiple_delete_confirm in modules/user/user.module
user_multiple_role_edit in modules/user/user.module
Callback function for admin mass adding/deleting a user role.
user_save in modules/user/user.module
Save changes to a user account or add a new user.
_blogapi_space_used in modules/blogapi/blogapi.module
_comment_update_node_statistics in modules/comment/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/forum.module
Returns the vocabulary id for forum navigation.
_forum_new in modules/forum/forum.module
Finds the first unread node for a given forum.
_forum_topics_unread in modules/forum/forum.module
Calculate the number of nodes the user has not yet read and are newer than NODE_NEW_LIMIT.
_update_178_url_formats in modules/system/system.install

Код

<?php
function db_result($result, $row = 0) {
  if ($result && mysql_num_rows($result) > $row) {
    return mysql_result($result, $row);
  }
  return FALSE;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

Вход в систему