db_select

  1. drupal
    1. drupal7
Versionen
drupal7 db_select($table, $alias = NULL, array $options = array())

Returns a new SelectQuery object for the active database.

Übergabeparameter

$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.

Rückgabewert

A new SelectQuery object for this connection.

Verwandte Themen

▾ 136 functions call db_select()

actions_do in includes/actions.inc
Perform a given list of actions by executing their callback functions.
block_form_system_performance_settings_alter in modules/block/block.module
Implementation of hook_form_FORM_ID_alter().
blog_block_view in modules/blog/blog.module
Implementation of 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
Implementation of 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.
CategorizeFeedItemTestCase::testCategorizeFeedItem in modules/aggregator/aggregator.test
If a feed has a category, make sure that the children inherit that categorization.
comment_admin_overview in modules/comment/comment.admin.inc
Form builder; Builds the comment overview form for the admin.
comment_get_recent in modules/comment/comment.module
Find the most recent comments that are available to the current user.
comment_render in modules/comment/comment.module
Renders comment(s).
comment_validate in modules/comment/comment.module
Validate comment data.
DatabaseAlter2TestCase::testAlterChangeFields in modules/simpletest/tests/database_test.test
Test that we can alter the fields of a query.
DatabaseAlter2TestCase::testAlterExpression in modules/simpletest/tests/database_test.test
Test that we can alter expressions in the query.
DatabaseAlter2TestCase::testAlterRemoveRange in modules/simpletest/tests/database_test.test
Test that we can remove a range() value from a query. This also tests hook_query_TAG_alter().
DatabaseAlterTestCase::testAlterChangeConditional in modules/simpletest/tests/database_test.test
Test that we can alter a query's conditionals.
DatabaseAlterTestCase::testAlterWithJoin in modules/simpletest/tests/database_test.test
Test that we can alter the joins on a query.
DatabaseAlterTestCase::testSimpleAlter in modules/simpletest/tests/database_test.test
Test that we can do basic alters.
DatabaseInvalidDataTestCase::testInsertDuplicateData in modules/simpletest/tests/database_test.test
Traditional SQL database systems abort inserts when invalid data is encountered.
DatabaseSelectComplexTestCase::testCountQuery in modules/simpletest/tests/database_test.test
Test that we can generate a count query from a built query.
DatabaseSelectComplexTestCase::testDefaultJoin in modules/simpletest/tests/database_test.test
Test simple JOIN statements.
DatabaseSelectComplexTestCase::testDistinct in modules/simpletest/tests/database_test.test
Test distinct queries.
DatabaseSelectComplexTestCase::testGroupBy in modules/simpletest/tests/database_test.test
Test GROUP BY clauses.
DatabaseSelectComplexTestCase::testGroupByAndHaving in modules/simpletest/tests/database_test.test
Test GROUP BY and HAVING clauses together.
DatabaseSelectComplexTestCase::testLeftOuterJoin in modules/simpletest/tests/database_test.test
Test LEFT OUTER joins.
DatabaseSelectComplexTestCase::testNestedConditions in modules/simpletest/tests/database_test.test
Confirm that we can properly nest conditional clauses.
DatabaseSelectComplexTestCase::testRange in modules/simpletest/tests/database_test.test
Test range queries. The SQL clause varies with the database.
DatabaseSelectOrderedTestCase::testSimpleSelectMultiOrdered in modules/simpletest/tests/database_test.test
Test multiple order by.
DatabaseSelectOrderedTestCase::testSimpleSelectOrdered in modules/simpletest/tests/database_test.test
Test basic order by.
DatabaseSelectOrderedTestCase::testSimpleSelectOrderedDesc in modules/simpletest/tests/database_test.test
Test order by descending.
DatabaseSelectPagerDefaultTestCase::testHavingPagerQuery in modules/simpletest/tests/database_test.test
Confirm that a paging query with a having expression returns valid results.
DatabaseSelectPagerDefaultTestCase::testInnerPagerQuery in modules/simpletest/tests/database_test.test
Confirm that a pager query with inner pager query returns valid results.
DatabaseSelectSubqueryTestCase::testFromSubquerySelect in modules/simpletest/tests/database_test.test
Test that we can use a subquery in a FROM clause.
DatabaseSelectSubqueryTestCase::testJoinSubquerySelect in modules/simpletest/tests/database_test.test
Test that we can use a subquery in a JOIN clause.
DatabaseSelectTestCase::testNotNullCondition in modules/simpletest/tests/database_test.test
Test that we can find a record without a NULL value.
DatabaseSelectTestCase::testNullCondition in modules/simpletest/tests/database_test.test
Test that we can find a record with a NULL value.
DatabaseSelectTestCase::testSimpleSelect in modules/simpletest/tests/database_test.test
Test rudimentary SELECT statements.
DatabaseSelectTestCase::testSimpleSelectAllFields in modules/simpletest/tests/database_test.test
Test adding all fields from a given table to a select statement.
DatabaseSelectTestCase::testSimpleSelectConditional in modules/simpletest/tests/database_test.test
Test basic conditionals on SELECT statements.
DatabaseSelectTestCase::testSimpleSelectExpression in modules/simpletest/tests/database_test.test
Test SELECT statements with expressions.
DatabaseSelectTestCase::testSimpleSelectExpressionMultiple in modules/simpletest/tests/database_test.test
Test SELECT statements with multiple expressions.
DatabaseSelectTestCase::testSimpleSelectMultipleFields in modules/simpletest/tests/database_test.test
Test adding multiple fields to a select statement at the same time.
DatabaseTaggingTestCase::testHasAllTags in modules/simpletest/tests/database_test.test
Test query tagging "has all of these tags" functionality.
DatabaseTaggingTestCase::testHasAnyTag in modules/simpletest/tests/database_test.test
Test query tagging "has at least one of these tags" functionality.
DatabaseTaggingTestCase::testHasTag in modules/simpletest/tests/database_test.test
Confirm that a query has a "tag" added to it.
DatabaseTaggingTestCase::testMetaData in modules/simpletest/tests/database_test.test
Test that we can attach meta data to a query object.
DatabaseTemporaryQueryTestCase::countTableRows in modules/simpletest/tests/database_test.test
Return the number of rows of a table.
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.
DBLogTestCase::doUser in modules/dblog/dblog.test
Generate and verify user events.
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_session_count in includes/session.inc
Counts how many users are active on the site.
drupal_uninstall_modules in includes/install.inc
Calls the uninstall function and updates the system table for a given module.
FieldSqlStorageTestCase::testFieldAttachInsertAndUpdate in modules/field/modules/field_sql_storage/field_sql_storage.test
Reads mysql to verify correct data is written when using insert and update.
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
Implementation of hook_field_storage_load().
field_test_entity_load in modules/simpletest/tests/field_test.module
file_load_multiple in includes/file.inc
Load file objects from the database.
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.
forum_block_view in modules/forum/forum.module
Implementation of hook_block_view().
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.
locale_batch_by_language in includes/locale.inc
Prepare a batch to import translations for all enabled modules in a given language.
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_maintain in includes/menu.inc
Insert, update or delete an uncustomized menu link related to a module.
menu_link_save in includes/menu.inc
Save a menu link.
menu_local_tasks in includes/menu.inc
Collects the local tasks (tabs) for a given level.
menu_set_active_trail in includes/menu.inc
Set (or get) the active trail for the current page - the path to root in the menu tree.
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.
ModuleTestCase::assertLogMessage in modules/system/system.test
Verify a log entry was entered for a module's status change. Called in the same way of the expected original watchdog() execution.
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_feed in modules/node/node.module
A generic function for generating RSS feeds from a set of nodes.
node_load_multiple in modules/node/node.module
Load node objects from the database.
node_page_default in modules/node/node.module
Menu callback; Generate a listing of promoted nodes.
node_user_cancel in modules/node/node.module
Implementation of hook_user_cancel().
path_admin_overview in modules/path/path.admin.inc
Return a listing of all defined URL aliases. When filter key passed, perform a standard search on the given key, and return the list of matching URL aliases.
poll_block_view in modules/poll/poll.module
Implementation of hook_block_view().
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.
SessionTestCase::getWarningCount in modules/simpletest/tests/session.test
Count watchdog messages about modifying $_SESSION without having started a session.
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.module
Menu callback. Display 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_form_alter in modules/taxonomy/taxonomy.module
Implementation of hook_form_alter(). Generate a form for selecting terms to associate with a node. We check for taxonomy_override_selector before loading the full vocabulary, so contrib modules can intercept before hook_form_alter and provide scalable…
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_term_by_name in modules/taxonomy/taxonomy.module
Try to map a string to an existing term, as for glossary use.
taxonomy_get_tids_from_nodes in modules/taxonomy/taxonomy.module
Find all term IDs associated with a set of nodes.
taxonomy_get_tree in modules/taxonomy/taxonomy.module
Create a hierarchical representation of a vocabulary.
taxonomy_node_get_terms in modules/taxonomy/taxonomy.module
Find all terms associated with the given node, ordered by vocabulary and term weight.
taxonomy_node_get_terms_by_vocabulary in modules/taxonomy/taxonomy.module
Find all terms associated with the given node, within one vocabulary.
taxonomy_overview_terms in modules/taxonomy/taxonomy.admin.inc
Form builder for the taxonomy terms overview.
taxonomy_select_nodes in modules/taxonomy/taxonomy.module
Finds all nodes that match selected taxonomy conditions.
taxonomy_term_count_nodes in modules/taxonomy/taxonomy.module
Count the number of published nodes classified by a term.
taxonomy_term_load_multiple in modules/taxonomy/taxonomy.module
Load multiple taxonomy terms based on certain conditions.
taxonomy_term_page in modules/taxonomy/taxonomy.pages.inc
Menu callback; displays all nodes associated with a term.
taxonomy_vocabulary_load_multiple in modules/taxonomy/taxonomy.module
Load multiple taxonomy vocabularies based on certain conditions.
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.
user_admin_account in modules/user/user.admin.inc
Form builder; User administration page.
user_load_multiple in modules/user/user.module
Load multiple users based on certain conditions.
user_search in modules/user/user.module
Implementation of hook_search().
_blog_post_exists in modules/blog/blog.module
Helper function to determine if a user has blog posts already.
_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

Code

includes/database/database.inc, line 1940

<?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);
}
?>

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen