function db_delete

7.x database.inc db_delete($table, array $options = array())
8.x database.inc db_delete($table, array $options = array())

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

DeleteQuery A new DeleteQuery object for this connection.

Related topics

171 calls to db_delete()
ActionLoopTestCase::testActionLoop in drupal/modules/simpletest/tests/actions.test
Set up a loop with 3 - 12 recursions, and see if it aborts properly.
actions_delete in drupal/includes/actions.inc
Deletes a single action from the database.
aggregator_aggregator_remove in drupal/modules/aggregator/aggregator.processor.inc
Implements hook_aggregator_remove().
aggregator_categorize_items_submit in drupal/modules/aggregator/aggregator.pages.inc
Form submission handler for aggregator_categorize_items().
aggregator_expire in drupal/modules/aggregator/aggregator.processor.inc
Expires items from a feed depending on expiration settings.

... See full list

File

drupal/includes/database/database.inc, line 2513
Core systems for the database layer.

Code

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