db_select($table, $alias = NULL, array $options = array())
drupal/includes/database/database.inc, line 1763
Returns a new SelectQuery object for the active database.
$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.
A new SelectQuery object for this connection.
| Name | Description |
|---|---|
| Database abstraction layer | Allow the use of different database servers using the same code base. |
function db_select($table, $alias = NULL, array $options = array()) {
if (empty($options['target'])) {
$options['target'] = 'default';
}
return Database::getActiveConnection($options['target'])->select($table, $alias, $options);
}