db_query

  1. drupal
    1. 4.7 database.inc
    2. 5 database.inc
    3. 6 database.pgsql.inc
    4. 6 database.mysql-common.inc
    5. 7
Versions
4.7 – 6 db_query($query)
7 db_query($query, array $args = array(), array $options = array())

Executes an arbitrary query string against the active database.

Use this function for SELECT queries if it is just a simple query string. If the caller or other modules need to change the query, use db_select() instead.

Do not use this function for INSERT, UPDATE, or DELETE queries. Those should be handled via db_insert(), db_update() and db_delete() respectively.

Parameters

$query The prepared statement query to run. Although it will accept both named and unnamed placeholders, named placeholders are strongly preferred as they are more self-documenting.

$args An array of values to substitute into the query. If the query uses named placeholders, this is an associative array in any order. If the query uses unnamed placeholders (?), this is an indexed array and the order must match the order of placeholders in the query string.

$options An array of options to control how the query operates.

Return value

DatabaseStatementInterface A prepared statement object, already executed.

See also

DatabaseConnection::defaultOptions()

Related topics

▾ 275 functions call db_query()

actions_do in drupal/includes/actions.inc
Performs a given list of actions by executing their callback functions.
actions_function_lookup in drupal/includes/actions.inc
Given a hash of an action array key, returns the key (function or ID).
actions_get_all_actions in drupal/includes/actions.inc
Retrieves all action instances from the database.
actions_load in drupal/includes/actions.inc
Retrieves a single action from the database.
actions_synchronize in drupal/includes/actions.inc
Synchronizes actions that are provided by modules in hook_action_info().
aggregator_aggregator_process in drupal/modules/aggregator/aggregator.processor.inc
Implements hook_aggregator_process().
aggregator_aggregator_remove in drupal/modules/aggregator/aggregator.processor.inc
Implements hook_aggregator_remove().
aggregator_block_configure in drupal/modules/aggregator/aggregator.module
Implements hook_block_configure().
aggregator_block_info in drupal/modules/aggregator/aggregator.module
Implements hook_block_info().
aggregator_block_view in drupal/modules/aggregator/aggregator.module
Implements hook_block_view().
aggregator_categorize_items in drupal/modules/aggregator/aggregator.pages.inc
Form builder; build the page list form.
aggregator_category_load in drupal/modules/aggregator/aggregator.module
Load an aggregator category.
aggregator_cron in drupal/modules/aggregator/aggregator.module
Implements hook_cron().
aggregator_expire in drupal/modules/aggregator/aggregator.processor.inc
Expire feed items on $feed that are older than aggregator_clear.
aggregator_feed_items_load in drupal/modules/aggregator/aggregator.pages.inc
Load feed items
aggregator_feed_load in drupal/modules/aggregator/aggregator.module
Load an aggregator feed.
aggregator_form_category_validate in drupal/modules/aggregator/aggregator.admin.inc
Validate aggregator_form_feed form submissions.
aggregator_form_feed in drupal/modules/aggregator/aggregator.admin.inc
Form builder; Generate a form to add/edit feed sources.
aggregator_form_feed_validate in drupal/modules/aggregator/aggregator.admin.inc
Validate aggregator_form_feed() form submissions.
aggregator_form_opml in drupal/modules/aggregator/aggregator.admin.inc
Form builder; Generate a form to import feeds from OPML.
aggregator_form_opml_submit in drupal/modules/aggregator/aggregator.admin.inc
Process aggregator_form_opml form submissions.
aggregator_page_categories in drupal/modules/aggregator/aggregator.pages.inc
Menu callback; displays all the categories used by the aggregator.
aggregator_page_opml in drupal/modules/aggregator/aggregator.pages.inc
Menu callback; generates an OPML representation of all feeds.
aggregator_page_rss in drupal/modules/aggregator/aggregator.pages.inc
Menu callback; generate an RSS 0.92 feed of aggregator items or categories.
aggregator_page_sources in drupal/modules/aggregator/aggregator.pages.inc
Menu callback; displays all the feeds used by the aggregator.
aggregator_save_feed in drupal/modules/aggregator/aggregator.module
Add/edit/delete an aggregator feed.
aggregator_save_item in drupal/modules/aggregator/aggregator.processor.inc
Add/edit/delete an aggregator item.
aggregator_view in drupal/modules/aggregator/aggregator.admin.inc
Displays the aggregator administration page.
BatchQueue::getAllItems in drupal/includes/batch.queue.inc
Retrieve all remaining items in the queue.
batch_example_batch_2 in examples/batch_example/batch_example.module
Batch 2 : Prepare a batch definition that will load all nodes 20 times.
batch_example_op_2 in examples/batch_example/batch_example.module
Batch operation for batch 2 : load all nodes, 5 by five After each group of 5 control is returned to the batch API for later continuation.
batch_example_update_7100 in examples/batch_example/batch_example.install
Example of batch-driven update function.
batch_load in drupal/includes/batch.inc
Loads a batch from the database.
blocked_ip_load in drupal/modules/system/system.module
Retrieve a blocked IP address from the database.
block_admin_configure in drupal/modules/block/block.admin.inc
Form builder for the block configuration form.
block_block_info in drupal/modules/block/block.module
Implements hook_block_info().
block_block_list_alter in drupal/modules/block/block.module
Implements hook_block_list_alter().
block_block_view in drupal/modules/block/block.module
Implements hook_block_view().
block_custom_block_get in drupal/modules/block/block.module
Returns information from database about a user-created (custom) block.
block_flush_caches in drupal/modules/block/block.module
Implements hook_flush_caches().
block_form_user_profile_form_alter in drupal/modules/block/block.module
Implements hook_form_FORM_ID_alter().
block_load in drupal/modules/block/block.module
Load a block object from the database.
block_theme_initialize in drupal/modules/block/block.module
Assign an initial, default set of blocks for a theme.
block_update_7004 in drupal/modules/block/block.install
Add new blocks to new regions, migrate custom variables to blocks.
block_update_7005 in drupal/modules/block/block.install
Update the {block_custom}.format column.
book_get_books in drupal/modules/book/book.module
Returns an array of all books.
book_link_load in drupal/modules/book/book.module
Like menu_link_load(), but adds additional data from the {book} table.
book_node_delete in drupal/modules/book/book.module
Implements hook_node_delete().
book_node_load in drupal/modules/book/book.module
Implements hook_node_load().
comment_count_unpublished in drupal/modules/comment/comment.module
Returns a menu title which includes the number of unapproved comments.
comment_delete_multiple in drupal/modules/comment/comment.module
Delete comments and all their replies.
comment_form_node_form_alter in drupal/modules/comment/comment.module
Implements hook_form_BASE_FORM_ID_alter().
comment_multiple_delete_confirm in drupal/modules/comment/comment.admin.inc
List the selected comments and verify that the admin wants to delete them.
comment_new_page_count in drupal/modules/comment/comment.module
Calculate page number for first new comment.
comment_node_delete in drupal/modules/comment/comment.module
Implements hook_node_delete().
comment_node_load in drupal/modules/comment/comment.module
Implements hook_node_load().
comment_node_search_result in drupal/modules/comment/comment.module
Implements hook_node_search_result().
comment_node_update_index in drupal/modules/comment/comment.module
Implements hook_node_update_index().
comment_num_new in drupal/modules/comment/comment.module
Get number of new comments for current user and specified node.
comment_publish_action in drupal/modules/comment/comment.module
Publishes a comment.
comment_reply in drupal/modules/comment/comment.pages.inc
This function is responsible for generating a comment reply form. There are several cases that have to be handled, including:
comment_save in drupal/modules/comment/comment.module
Accepts a submission of new or changed comment content.
comment_unpublish_action in drupal/modules/comment/comment.module
Unpublishes a comment.
comment_update_7001 in drupal/modules/comment/comment.install
Change comment status from published being 0 to being 1
comment_update_7003 in drupal/modules/comment/comment.install
Split {comment}.timestamp into 'created' and 'changed', improve indexing on {comment}.
comment_update_7006 in drupal/modules/comment/comment.install
Migrate data from the comment field to field storage.
comment_update_index in drupal/modules/comment/comment.module
Implements hook_update_index().
comment_user_delete in drupal/modules/comment/comment.module
Implements hook_user_delete().
contact_site_form in drupal/modules/contact/contact.pages.inc
Form builder; the site-wide contact form.
dashboard_show_block_content in drupal/modules/dashboard/dashboard.module
Ajax callback to display the rendered contents of a specific block.
DatabaseSchema_sqlite::findTables in drupal/includes/database/sqlite/schema.inc
Find all tables that are like the specified base table name.
DatabaseTasks::runTestQuery in drupal/includes/install.inc
Run SQL tests to ensure the database can execute commands with the current user.
DatabaseTasks_pgsql::checkBinaryOutput in drupal/includes/database/pgsql/install.inc
Check Binary Output.
DatabaseTasks_pgsql::checkBinaryOutputSuccess in drupal/includes/database/pgsql/install.inc
Verify that a binary data roundtrip returns the original string.
DatabaseTasks_pgsql::checkEncoding in drupal/includes/database/pgsql/install.inc
Check encoding is UTF8.
DatabaseTasks_pgsql::initializeDatabase in drupal/includes/database/pgsql/install.inc
Make PostgreSQL Drupal friendly.
dblog_event in drupal/modules/dblog/dblog.admin.inc
Menu callback; displays details about a log message.
DrupalDatabaseCache::getMultiple in drupal/includes/cache.inc
Return data from the persistent cache when given an array of cache IDs.
DrupalWebTestCase::drupalCreateRole in drupal/modules/simpletest/drupal_web_test_case.php
Internal helper function; Create a role with specified permissions.
DrupalWebTestCase::setUp in drupal/modules/simpletest/drupal_web_test_case.php
Generates a random database prefix, runs the install scripts on the prefixed database and enable the specified modules. After installation many caches are flushed and the internal browser is setup so that the page requests will run on the new prefix.…
drupal_get_filename in drupal/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_get_installed_schema_version in drupal/includes/install.inc
Returns the currently installed schema version for a module.
drupal_is_denied in drupal/includes/bootstrap.inc
Check to see if an IP address has been blocked.
drupal_lookup_path in drupal/includes/path.inc
Given an alias, return its Drupal system URL if one exists. Given a Drupal system URL return one of its aliases if such a one exists. Otherwise, return FALSE.
drupal_path_alias_whitelist_rebuild in drupal/includes/path.inc
Rebuild the path alias white list.
drupal_valid_path in drupal/includes/path.inc
Checks a path exists and the current user has access to it.
error_test_trigger_pdo_exception in drupal/modules/simpletest/tests/error_test.module
Menu callback; trigger an exception to test the exception handler.
field_sql_storage_update_7001 in drupal/modules/field/modules/field_sql_storage/field_sql_storage.install
Remove the field_config_entity_type table and store 'entity_type' strings.
field_update_7001 in drupal/modules/field/field.install
Fix fields definitions created during the d6 to d7 upgrade path.
file_example_get_managed_file in examples/file_example/file_example.module
Utility function to check for and return a managed file. In this demonstration code we don't necessarily know if a file is managed or not, so often need to check to do the correct behavior. Normal code would not have to do this, as it would be…
filter_admin_format_form_validate in drupal/modules/filter/filter.admin.inc
Validate text format form submissions.
filter_list_format in drupal/modules/filter/filter.module
Retrieve a list of filters for a given text format.
filter_update_7001 in drupal/modules/filter/filter.install
Break out "escape HTML filter" option to its own filter.
filter_update_7005 in drupal/modules/filter/filter.install
Integrate text formats with the user permissions system.
filter_update_7008 in drupal/modules/filter/filter.install
Grant usage of all text formats to user roles having the 'administer filters' permission.
flood_is_allowed in drupal/includes/common.inc
Checks whether user is allowed to proceed with the specified event.
forum_get_topics in drupal/modules/forum/forum.module
forum_node_update in drupal/modules/forum/forum.module
Implements hook_node_update().
hook_block_list_alter in drupal/modules/block/block.api.php
Act on blocks prior to rendering.
hook_comment_load in drupal/modules/comment/comment.api.php
Comments are being loaded from the database.
hook_cron in drupal/modules/system/system.api.php
Perform periodic actions.
hook_file_download in drupal/modules/system/system.api.php
Control access to private file downloads and specify HTTP headers.
hook_file_load in drupal/modules/system/system.api.php
Load additional information into file objects.
hook_load in drupal/modules/node/node.api.php
Act on nodes being loaded from the database.
hook_menu_link_update in drupal/modules/system/system.api.php
Inform modules that a menu link has been updated.
hook_node_load in drupal/modules/node/node.api.php
Act on nodes being loaded from the database.
hook_node_search_result in drupal/modules/node/node.api.php
Act on a node being displayed as a search result.
hook_node_update_index in drupal/modules/node/node.api.php
Act on a node being indexed for searching.
hook_search_status in drupal/modules/search/search.api.php
Report the status of indexing.
hook_taxonomy_term_load in drupal/modules/taxonomy/taxonomy.api.php
Act on taxonomy terms when loaded.
hook_update_N in drupal/modules/system/system.api.php
Perform a single update.
hook_user_load in drupal/modules/user/user.api.php
Act on user objects when loaded from the database.
install_verify_completed_task in drupal/includes/install.core.inc
Verify and return the last installation task that was completed.
language_list in drupal/includes/bootstrap.inc
Get a list of languages set up indexed by the specified key
list_update_7001 in drupal/modules/field/modules/list/list.install
Rename the list field types and change 'allowed_values' format.
locale in drupal/modules/locale/locale.module
Provides interface translation services.
locale_batch_by_component in drupal/includes/locale.inc
Prepare a batch to run when installing modules or enabling themes.
locale_languages_edit_form in drupal/modules/locale/locale.admin.inc
Editing screen for a particular language.
locale_languages_edit_form_validate in drupal/modules/locale/locale.admin.inc
Validate the language editing form. Reused for custom language addition too.
locale_languages_predefined_form_validate in drupal/modules/locale/locale.admin.inc
Validate the language addition form.
locale_translate_delete_page in drupal/modules/locale/locale.admin.inc
String deletion confirmation page.
locale_translate_edit_form in drupal/modules/locale/locale.admin.inc
User interface for string editing.
locale_translate_edit_form_submit in drupal/modules/locale/locale.admin.inc
Process string editing form submissions.
locale_translate_overview_screen in drupal/modules/locale/locale.admin.inc
Overview screen for translations.
locale_uninstall in drupal/modules/locale/locale.install
Implements hook_uninstall().
lock_may_be_available in drupal/includes/lock.inc
Check if lock acquired by a different process may be available.
menu_delete_menu_confirm in drupal/modules/menu/menu.admin.inc
Build a confirm form for deletion of a custom menu.
menu_delete_menu_confirm_submit in drupal/modules/menu/menu.admin.inc
Delete a custom menu and all links in it.
menu_edit_menu_submit in drupal/modules/menu/menu.admin.inc
Submit function for adding or editing a custom menu.
menu_enable in drupal/modules/menu/menu.module
Implements hook_enable().
menu_link_delete in drupal/includes/menu.inc
Delete one or several menu links.
menu_link_maintain in drupal/includes/menu.inc
Insert, update or delete an uncustomized menu link related to a module.
menu_link_save in drupal/includes/menu.inc
Save a menu link.
menu_load_all in drupal/modules/menu/menu.module
Load all custom menu data.
menu_node_delete in drupal/modules/menu/menu.module
Implements hook_node_delete().
menu_overview_form in drupal/modules/menu/menu.admin.inc
Form for editing an entire menu tree at once.
menu_overview_page in drupal/modules/menu/menu.admin.inc
Menu callback which shows an overview page of all the custom menus and their descriptions.
module_enable in drupal/includes/module.inc
Enables or installs a given list of modules.
node_access_example_node_load in examples/node_access_example/node_access_example.module
node_access_example_node_update in examples/node_access_example/node_access_example.module
Implements hook_nodeapi_update().
node_access_rebuild in drupal/modules/node/node.module
Rebuild the node access database. This is occasionally needed by modules that make system-wide changes to access levels.
node_admin_nodes in drupal/modules/node/node.admin.inc
Form builder: Builds the node administration overview.
node_assign_owner_action in drupal/modules/node/node.module
Assigns ownership of a node to a user.
node_assign_owner_action_form in drupal/modules/node/node.module
Generates the settings form for node_assign_owner_action().
node_assign_owner_action_submit in drupal/modules/node/node.module
Saves settings form for node_assign_owner_action().
node_block_list_alter in drupal/modules/node/node.module
Implements hook_block_list_alter().
node_example_page in examples/node_example/node_example.module
Custom callback that builds our content and returns it to the browser.
node_example_uninstall in examples/node_example/node_example.install
Implements hook_uninstall().
node_form_block_admin_configure_alter in drupal/modules/node/node.module
Implements hook_form_FORMID_alter().
node_get_recent in drupal/modules/node/node.module
Find the most recent nodes that are available to the current user.
node_last_changed in drupal/modules/node/node.module
node_last_viewed in drupal/modules/node/node.module
Retrieves the timestamp at which the current user last viewed the specified node.
node_multiple_delete_confirm in drupal/modules/node/node.admin.inc
node_requirements in drupal/modules/node/node.module
Implements hook_requirements().
node_revision_delete_confirm_submit in drupal/modules/node/node.pages.inc
node_revision_list in drupal/modules/node/node.module
Return a list of all the existing revision numbers.
node_search_status in drupal/modules/node/node.module
Implements hook_search_status().
node_type_delete_confirm in drupal/modules/node/content_types.inc
Menu callback; delete a single content type.
node_update_7006 in drupal/modules/node/node.install
Convert body and teaser from node properties to fields, and migrate status/comment/promote and sticky columns to the {node_revision} table.
node_user_delete in drupal/modules/node/node.module
Implements hook_user_delete().
openid_association in drupal/modules/openid/openid.module
Attempt to create a shared secret with the OpenID Provider.
openid_user_add_validate in drupal/modules/openid/openid.pages.inc
openid_user_delete_form in drupal/modules/openid/openid.pages.inc
Menu callback; Delete the specified OpenID identity from the system.
openid_user_identities in drupal/modules/openid/openid.pages.inc
Menu callback; Manage OpenID identities for the specified user.
openid_verify_assertion in drupal/modules/openid/openid.module
Attempt to verify the response received from the OpenID Provider.
openid_verify_assertion_nonce in drupal/modules/openid/openid.module
Verify that the nonce has not been used in earlier assertions from the same OpenID provider.
path_admin_form_validate in drupal/modules/path/path.admin.inc
Verify that a URL alias is valid
poll_cron in drupal/modules/poll/poll.module
Implements hook_cron().
poll_load in drupal/modules/poll/poll.module
Implements hook_load().
profile_admin_overview in drupal/modules/profile/profile.admin.inc
Form builder to display a listing of all editable profile fields.
profile_block_configure in drupal/modules/profile/profile.module
Implements hook_block_configure().
profile_block_view in drupal/modules/profile/profile.module
Implements hook_block_view().
profile_browse in drupal/modules/profile/profile.pages.inc
Menu callback; display a list of user information.
profile_field_delete in drupal/modules/profile/profile.admin.inc
Menu callback; deletes a field from all user profiles.
profile_field_form in drupal/modules/profile/profile.admin.inc
Menu callback: Generate a form to add/edit a user profile field.
profile_user_categories in drupal/modules/profile/profile.module
Implements hook_user_categories().
profile_user_load in drupal/modules/profile/profile.module
Implements hook_user_load().
profile_user_view in drupal/modules/profile/profile.module
Implements hook_user_view().
queue_example_retrieve_queue in examples/queue_example/queue_example.module
Retrieve the queue from the database for display purposes only.
registry_get_parsed_files in drupal/includes/registry.inc
Return the list of files in registry_file
search_index in drupal/modules/search/search.module
Update the full-text search index for a particular item.
search_node_update_index in drupal/modules/search/search.module
Implements hook_node_update_index().
search_update_totals in drupal/modules/search/search.module
Updates the {search_total} database table.
shortcut_set_delete_form in drupal/modules/shortcut/shortcut.admin.inc
Form callback: builds the confirmation form for deleting a shortcut set.
shortcut_set_get_unique_name in drupal/modules/shortcut/shortcut.module
Returns a unique, machine-readable shortcut set name.
simpletest_clean_results_table in drupal/modules/simpletest/simpletest.module
Clear the test result tables.
simpletest_test_get_all in drupal/modules/simpletest/simpletest.module
Get a list of all of the tests provided by the system.
statistics_access_log in drupal/modules/statistics/statistics.admin.inc
Menu callback; Displays recent page accesses.
statistics_get in drupal/modules/statistics/statistics.module
Retrieves a node's "view statistics".
statistics_update_index in drupal/modules/statistics/statistics.module
Implements hook_update_index().
SystemQueue::numberOfItems in drupal/modules/system/system.queue.inc
system_actions_configure in drupal/modules/system/system.admin.inc
Menu callback; Creates the form for configuration of a single action.
system_actions_manage in drupal/modules/system/system.admin.inc
Menu callback; Displays an overview of available and configured actions.
system_admin_config_page in drupal/modules/system/system.admin.inc
Menu callback; Provide the administration overview page.
system_admin_menu_block in drupal/modules/system/system.module
Provide a single block on the administration overview page.
system_cron in drupal/modules/system/system.module
Implements hook_cron().
system_date_format_locale in drupal/modules/system/system.module
Gets the appropriate date format string for a date type and locale.
system_get_date_format in drupal/modules/system/system.module
Gets the format details for a particular format ID.
system_get_files_database in drupal/modules/system/system.module
Retrieves the current status of an array of files in the system table.
system_ip_blocking in drupal/modules/system/system.admin.inc
Menu callback. Display blocked IP addresses.
system_ip_blocking_form_validate in drupal/modules/system/system.admin.inc
system_list in drupal/includes/module.inc
Build a list of bootstrap modules and enabled modules and themes.
system_update_7000 in drupal/modules/system/system.install
Rename blog and forum permissions to be consistent with other content types.
system_update_7003 in drupal/modules/system/system.install
Update {blocked_ips} with valid IP addresses from {access}.
system_update_7007 in drupal/modules/system/system.install
Convert to new method of storing permissions.
system_update_7011 in drupal/modules/system/system.install
Split the 'bypass node access' permission from 'administer nodes'.
system_update_7013 in drupal/modules/system/system.install
Convert default time zone offset to default time zone name.
system_update_7016 in drupal/modules/system/system.install
Remove custom datatype *_unsigned in PostgreSQL.
system_update_7036 in drupal/modules/system/system.install
Split the 'access site in maintenance mode' permission from 'administer site configuration'.
system_update_7053 in drupal/modules/system/system.install
Upgrade standard blocks and menus.
system_update_7060 in drupal/modules/system/system.install
Create fields in preparation for migrating upload.module to file.module.
system_update_7061 in drupal/modules/system/system.install
Migrate upload.module data to the newly created file field.
system_update_7063 in drupal/modules/system/system.install
Delete {menu_links} records for 'type' => MENU_CALLBACK which would not appear in a fresh install.
system_update_files_database in drupal/modules/system/system.module
Updates the records in the system table based on the files array.
taxonomy_update_7002 in drupal/modules/taxonomy/taxonomy.install
Add {vocabulary}.machine_name column.
taxonomy_update_7004 in drupal/modules/taxonomy/taxonomy.install
Move taxonomy vocabulary associations for nodes to fields and field instances.
taxonomy_update_7005 in drupal/modules/taxonomy/taxonomy.install
Migrate {taxonomy_term_node} table to field storage.
taxonomy_vocabulary_delete in drupal/modules/taxonomy/taxonomy.module
Delete a vocabulary.
taxonomy_vocabulary_get_names in drupal/modules/taxonomy/taxonomy.module
Get names for all taxonomy vocabularies.
toolbar_get_menu_tree in drupal/modules/toolbar/toolbar.module
Get only the top level items below the 'admin' path.
tracker_enable in drupal/modules/tracker/tracker.install
Implements hook_enable().
tracker_page in drupal/modules/tracker/tracker.pages.inc
Menu callback; prints a listing of active nodes on the site.
tracker_update_7000 in drupal/modules/tracker/tracker.install
Create new tracker_node and tracker_user tables.
translation_remove_from_set in drupal/modules/translation/translation.module
Remove a node from its translation set (if any) and update the set accordingly.
trigger_assign_form_submit in drupal/modules/trigger/trigger.admin.inc
Submit function for trigger_assign_form().
trigger_assign_form_validate in drupal/modules/trigger/trigger.admin.inc
Validation function for trigger_assign_form().
trigger_get_assigned_actions in drupal/modules/trigger/trigger.module
Gets the action IDs of actions to be executed for a hook.
trigger_update_7000 in drupal/modules/trigger/trigger.install
Adds operation names to the hook names and drops the "op" field.
update_fix_compatibility in drupal/includes/update.inc
Disable any items in the {system} table that are not core compatible.
update_fix_d7_block_deltas in drupal/includes/update.inc
A helper function that modules can use to assist with the transformation from numeric block deltas to string block deltas during the 6.x -> 7.x upgrade.
update_fix_d7_requirements in drupal/includes/update.inc
Perform Drupal 6.x to 7.x updates that are required for update.php to function properly.
update_retrieve_dependencies in drupal/includes/update.inc
Invoke hook_update_dependencies() in all installed modules.
UserController::attachLoad in drupal/modules/user/user.module
Attaches data to entities upon loading. This will attach fields, if the entity is fieldable. It calls hook_entity_load() for modules which need to add data to all entities. It also calls hook_TYPE_load() on the loaded entities. For…
user_admin_account in drupal/modules/user/user.admin.inc
Form builder; User administration page.
user_block_view in drupal/modules/user/user.module
Implements hook_block_view().
user_external_load in drupal/modules/user/user.module
Fetches a user object based on an external authentication source.
user_get_authmaps in drupal/modules/user/user.module
Discover which external authentication module(s) authenticated a username.
user_login_authenticate_validate in drupal/modules/user/user.module
A validate handler on the login form. Check supplied username/password against local users table. If successful, $form_state['uid'] is set to the matching user ID.
user_multiple_role_edit in drupal/modules/user/user.module
Callback function for admin mass adding/deleting a user role.
user_node_load in drupal/modules/user/user.module
Implements hook_node_load().
user_role_permissions in drupal/modules/user/user.module
Determine the permissions for one or more roles.
user_save in drupal/modules/user/user.module
Save changes to a user account or add a new user.
user_update_7000 in drupal/modules/user/user.install
Increase the length of the password field to accommodate better hashes.
user_update_7002 in drupal/modules/user/user.install
Convert user time zones from time zone offsets to time zone names.
user_update_7010 in drupal/modules/user/user.install
Update the {user}.signature_format column.
user_update_7012 in drupal/modules/user/user.install
Add the user's pictures to the {file_managed} table and make them managed files.
user_update_7013 in drupal/modules/user/user.install
Add user module file usage entries.
variable_initialize in drupal/includes/bootstrap.inc
Load the persistent variable table.
_aggregator_has_categories in drupal/modules/aggregator/aggregator.module
Find out whether there are any aggregator categories.
_book_update_outline in drupal/modules/book/book.module
Common helper function to handles additions and updates to the book outline.
_comment_update_node_statistics in drupal/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.
_dblog_get_message_types in drupal/modules/dblog/dblog.module
_drupal_session_read in drupal/includes/session.inc
Session handler assigned by session_set_save_handler().
_forum_update_forum_index in drupal/modules/forum/forum.module
Updates the taxonomy index for a given node.
_forum_user_last_visit in drupal/modules/forum/forum.module
_locale_export_get_strings in drupal/includes/locale.inc
Generates a structured array of all strings with translations in $language, if given. This array can be used to generate an export of the string in the database.
_locale_import_one_string_db in drupal/includes/locale.inc
Import one string into the database.
_locale_import_po in drupal/includes/locale.inc
Parses Gettext Portable Object file information and inserts into database
_locale_parse_js_file in drupal/includes/locale.inc
Parses a JavaScript file, extracts strings wrapped in Drupal.t() and Drupal.formatPlural() and inserts them into the database.
_locale_rebuild_js in drupal/includes/locale.inc
(Re-)Creates the JavaScript translation file for a language.
_menu_delete_item in drupal/includes/menu.inc
Helper function for menu_link_delete; deletes a single menu link.
_menu_link_find_parent in drupal/includes/menu.inc
Find a possible parent for a given menu link.
_menu_router_build in drupal/includes/menu.inc
Helper function to build the router table based on the data from hook_menu.
_menu_set_expanded_menus in drupal/includes/menu.inc
Helper function to update a list of menus with expanded items
_node_access_rebuild_batch_operation in drupal/modules/node/node.module
Batch operation for node_access_rebuild_batch.
_node_revision_access in drupal/modules/node/node.module
_registry_update in drupal/includes/registry.inc
Does the work for registry_update().
_system_date_formats_build in drupal/modules/system/system.module
Builds and returns information about available date formats.
_system_date_format_types_build in drupal/modules/system/system.module
Builds and returns information about available date types.
_tracker_add in drupal/modules/tracker/tracker.module
Update indexing tables when a node is added, updated or commented on.
_tracker_calculate_changed in drupal/modules/tracker/tracker.module
Determine the max timestamp between $node->changed and the last comment.
_tracker_remove in drupal/modules/tracker/tracker.module
Clean up indexed data when nodes or comments are removed.
_update_7000_node_get_types in drupal/modules/node/node.install
Utility function: fetch the node types directly from the database.
_update_7002_taxonomy_get_vocabularies in drupal/modules/taxonomy/taxonomy.install
Utility function: get the list of vocabularies directly from the database.
_update_cache_get in drupal/modules/update/update.module
Retrieve data from the private update status cache table.

Code

drupal/includes/database/database.inc, line 2213

<?php
function db_query($query, array $args = array(), array $options = array()) {
  if (empty($options['target'])) {
    $options['target'] = 'default';
  }

  return Database::getConnection($options['target'])->query($query, $args, $options);
}
?>