function db_select

7.x database.inc 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

SelectQuery A new SelectQuery object for this connection.

Related topics

241 calls to db_select()
actions_do in drupal-7.x/includes/actions.inc
Performs a given list of actions by executing their callback functions.
aggregator_feed_items_load in drupal-7.x/modules/aggregator/aggregator.pages.inc
Loads and optionally filters feed items.
blog_block_view in drupal-7.x/modules/blog/blog.module
Implements hook_block_view().
blog_feed_last in drupal-7.x/modules/blog/blog.pages.inc
Menu callback; displays an RSS feed containing recent blog entries of all users.
blog_feed_user in drupal-7.x/modules/blog/blog.pages.inc
Menu callback; displays an RSS feed containing recent blog entries of a given user.

... See full list

File

drupal-7.x/includes/database/database.inc, line 2517
Core systems for the database layer.

Code

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