db_delete

Definition

db_delete($table, array $options = array())
drupal/includes/database/database.inc, line 1743

Description

Returns a new DeleteQuery object for the active database.

Parameters

$table The table from which to delete.

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

Return value

A new DeleteQuery object for this connection.

Related topics

Namesort iconDescription
Database abstraction layerAllow the use of different database servers using the same code base.

Code

function db_delete($table, array $options = array()) {
  if (empty($options['target']) || $options['target'] == 'slave') {
    $options['target'] = 'default';
  }
  return Database::getActiveConnection($options['target'])->delete($table, $options);
}