db_select

Versions
7
db_select($table, $alias = NULL, array $options = array())

Returns a new SelectQuery object for the active database.

Parameters

$table The base table for this query. May be a string or another SelectQuery object. If a query object is passed, it will be used as a subselect.

$alias The alias for the base table of this query.

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

Return value

A new SelectQuery object for this connection.

Related topics

▾ 115 functions call db_select()

actions_do in includes/actions.inc
Performs a given list of actions by executing their callback functions.
blog_block_view in modules/blog/blog.module
Implement hook_block_view().
blog_feed_last in modules/blog/blog.pages.inc
Menu callback; displays an RSS feed containing recent blog entries of all users.
blog_feed_user in modules/blog/blog.pages.inc
Menu callback; displays an RSS feed containing recent blog entries of a given user.
blog_page_last in modules/blog/blog.pages.inc
Menu callback; displays a Drupal page containing recent blog entries of all users.
blog_page_user in modules/blog/blog.pages.inc
Menu callback; displays a Drupal page containing recent blog entries of a given user.
book_block_view in modules/book/book.module
Implement hook_block_view().
book_get_books in modules/book/book.module
Returns an array of all books.
book_menu_subtree_data in modules/book/book.module
Get the data representing a subtree of the book hierarchy.
book_update_bid in modules/book/book.module
Update the bid for a page and its children when it is moved to a new book.
comment_admin_overview in modules/comment/comment.admin.inc
Form builder; Builds the comment overview form for the admin.
comment_enable in modules/comment/comment.install
Implement hook_enable().
comment_form_validate in modules/comment/comment.module
Validate comment form submissions.
comment_get_display_ordinal in modules/comment/comment.module
Get the display ordinal for a comment, starting from 0.
comment_get_recent in modules/comment/comment.module
Find the most recent comments that are available to the current user.
comment_get_thread in modules/comment/comment.module
Retrieve comments for a thread.
contact_site_form in modules/contact/contact.pages.inc
Form builder; the site-wide contact form.
dashboard_page_build in modules/dashboard/dashboard.module
Implement hook_page_build().
database_test_db_query_temporary in modules/simpletest/tests/database_test.module
Run a db_query_temporary and output the table name and its number of rows.
database_test_even_pager_query in modules/simpletest/tests/database_test.module
Run a pager query and return the results.
database_test_odd_pager_query in modules/simpletest/tests/database_test.module
Run a pager query and return the results.
database_test_tablesort in modules/simpletest/tests/database_test.module
Run a tablesort query and return the results.
database_test_tablesort_first in modules/simpletest/tests/database_test.module
Run a tablesort query with a second order_by after and return the results.
dblog_overview in modules/dblog/dblog.admin.inc
Menu callback; displays a listing of log messages.
dblog_top in modules/dblog/dblog.admin.inc
Menu callback; generic function to display a page of the most frequent dblog events of a specified type.
drupal_uninstall_modules in includes/install.inc
Calls the uninstall function and updates the system table for a given module.
field_read_fields in modules/field/field.crud.inc
Read in fields that match an array of conditions.
field_read_instances in modules/field/field.crud.inc
Read in field instances that match an array of conditions.
field_sql_storage_field_storage_load in modules/field/modules/field_sql_storage/field_sql_storage.module
Implement hook_field_storage_load().
field_sql_storage_field_storage_query in modules/field/modules/field_sql_storage/field_sql_storage.module
Implement hook_field_storage_query().
field_test_entity_test_load in modules/simpletest/tests/field_test.module
file_space_used in includes/file.inc
Determine total disk space used by a single user or the whole filesystem.
filter_formats in modules/filter/filter.module
Retrieve a list of text formats, ordered by weight.
filter_list_format in modules/filter/filter.module
Retrieve a list of filters for a given text format.
forum_block_view in modules/forum/forum.module
Implement hook_block_view().
forum_get_forums in modules/forum/forum.module
Returns a list of all forums for a given taxonomy id
forum_get_topics in modules/forum/forum.module
forum_node_load in modules/forum/forum.module
Implement hook_node_load().
hook_field_attach_form in modules/field/field.api.php
Act on field_attach_form.
hook_search_execute in modules/search/search.api.php
Execute a search for a set of key words.
hook_update_N in modules/system/system.api.php
Perform a single update. For each patch which requires a database change add a new hook_update_N() which will be called by update.php.
hook_user_cancel in modules/user/user.api.php
Act on user account cancellations.
image_effects in modules/image/image.module
Load all image effects from the database.
image_styles in modules/image/image.module
Get an array of all styles and their settings.
locale_batch_by_language in includes/locale.inc
Prepare a batch to import translations for all enabled modules in a given language.
menu_contextual_links in includes/menu.inc
Retrieve contextual links for a system object based on registered local tasks.
menu_get_item in includes/menu.inc
Get a router item.
menu_get_menus in modules/menu/menu.module
Return an associative array of the custom menus names.
menu_get_names in includes/menu.inc
Build a list of named menus.
menu_link_children_relative_depth in includes/menu.inc
Find the depth of an item's children relative to its depth.
menu_link_load in includes/menu.inc
Get a menu link by its mlid, access checked and link translated for rendering.
menu_link_save in includes/menu.inc
Save a menu link.
menu_load_links in includes/menu.inc
Returns an array containing all links for a menu.
menu_local_tasks in includes/menu.inc
Collects the local tasks (tabs), action links, and the root path.
menu_set_active_trail in includes/menu.inc
Sets or gets the active trail (path to root menu root) of the current page.
menu_tree_all_data in includes/menu.inc
Get the data structure representing a named menu tree.
menu_tree_check_access in includes/menu.inc
Check access and perform other dynamic operations for each link in the tree.
menu_tree_page_data in includes/menu.inc
Get the data structure representing a named menu tree, based on the current page.
node_access in modules/node/node.module
Determine whether the current user may perform the given operation on the specified node.
node_access_view_all_nodes in modules/node/node.module
Determine whether the user has a global viewing grant for all nodes.
node_admin_nodes in modules/node/node.admin.inc
Form builder: Builds the node administration overview.
node_feed in modules/node/node.module
A generic function for generating RSS feeds from a set of nodes.
node_page_default in modules/node/node.module
Menu callback; Generate a listing of promoted nodes.
node_search_execute in modules/node/node.module
Implement hook_search_execute().
node_update_7006 in 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_cancel in modules/node/node.module
Implement hook_user_cancel().
path_admin_overview in modules/path/path.admin.inc
Return a listing of all defined URL aliases.
path_form_element_validate in modules/path/path.module
Form element validation handler for URL alias form element.
path_load in includes/path.inc
Fetch a specific URL alias from the database.
poll_block_view in modules/poll/poll.module
Implement hook_block_view().
poll_load in modules/poll/poll.module
Implement hook_load().
poll_page in modules/poll/poll.pages.inc
Menu callback to provide a simple list of all polls available.
poll_votes in modules/poll/poll.pages.inc
Callback for the 'votes' tab for polls you can see other votes on
profile_browse in modules/profile/profile.pages.inc
Menu callback; display a list of user information.
profile_field_form_validate in modules/profile/profile.admin.inc
Validate profile_field_form submissions.
shortcut_current_displayed_set in modules/shortcut/shortcut.module
Returns the current displayed shortcut set for the provided user account.
shortcut_sets in modules/shortcut/shortcut.module
Returns an array of all shortcut sets, keyed by the set name.
shortcut_set_load in modules/shortcut/shortcut.module
Loads the data for a shortcut set.
simpletest_result_get in modules/simpletest/simpletest.pages.inc
Get test results for $test_id.
statistics_node_tracker in modules/statistics/statistics.pages.inc
statistics_recent_hits in modules/statistics/statistics.admin.inc
Menu callback; presents the "recent hits" page.
statistics_title_list in modules/statistics/statistics.module
Returns all time or today top or last viewed node(s).
statistics_top_pages in modules/statistics/statistics.admin.inc
Menu callback; presents the "top pages" page.
statistics_top_referrers in modules/statistics/statistics.admin.inc
Menu callback; presents the "referrer" page.
statistics_top_visitors in modules/statistics/statistics.admin.inc
Menu callback; presents the "top visitors" page.
statistics_user_tracker in modules/statistics/statistics.pages.inc
system_actions_manage in modules/system/system.admin.inc
Menu callback; Displays an overview of available and configured actions.
system_update_7004 in modules/system/system.install
Remove hardcoded numeric deltas from all blocks in core.
taxonomy_autocomplete in modules/taxonomy/taxonomy.pages.inc
Helper function for autocompletion
taxonomy_get_children in modules/taxonomy/taxonomy.module
Find all children of a term ID.
taxonomy_get_parents in modules/taxonomy/taxonomy.module
Find all parents of a given term ID.
taxonomy_get_tree in modules/taxonomy/taxonomy.module
Create a hierarchical representation of a vocabulary.
taxonomy_select_nodes in modules/taxonomy/taxonomy.module
Return nodes attached to a term across all field instances.
taxonomy_test_get_antonym in modules/simpletest/tests/taxonomy_test.module
Return the antonym of the given term ID.
taxonomy_update_7005 in modules/taxonomy/taxonomy.install
Migrate {taxonomy_term_node} table to field storage.
tracker_cron in modules/tracker/tracker.module
Implement hook_cron().
tracker_page in modules/tracker/tracker.pages.inc
Menu callback; prints a listing of active nodes on the site.
translation_node_get_translations in modules/translation/translation.module
Get all nodes in a translation set, represented by $tnid.
trigger_menu in modules/trigger/trigger.module
Implement hook_menu().
update_fix_d7_install_profile in includes/update.inc
Register the currently installed profile in the system table.
user_admin_account in modules/user/user.admin.inc
Form builder; User administration page.
user_role_load in modules/user/user.module
Fetch a user role from database.
user_search_execute in modules/user/user.module
Implement hook_search_execute().
_block_load_blocks in modules/block/block.module
Load blocks information from the database.
_blog_post_exists in modules/blog/blog.module
Helper function to determine if a user has blog posts already.
_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.
_locale_translate_seek in includes/locale.inc
Perform a string search and display results in a table
_menu_find_router_path in includes/menu.inc
Find the router path which will serve this path.
_menu_navigation_links_rebuild in includes/menu.inc
Helper function to build menu links for the items in the menu router.
_menu_update_parental_status in includes/menu.inc
Check and update the has_children status for the parent of a link.
_node_types_build in modules/node/node.module
Builds and returns the list of available node types.
_profile_get_fields in modules/profile/profile.module
_rdf_mapping_load in modules/rdf/rdf.module
Helper function to retrieve a RDF mapping from the database.
_search_get_module_names in modules/search/search.admin.inc
Helper function to get real module names.
_update_get_cache_multiple in modules/update/update.module
Return an array of cache items with a given cache ID prefix.

Code

includes/database/database.inc, line 2028

<?php
function db_select($table, $alias = NULL, array $options = array()) {
  if (empty($options['target'])) {
    $options['target'] = 'default';
  }
  return Database::getConnection($options['target'])->select($table, $alias, $options);
}
?>
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.