function db_delete

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

70 calls to db_delete()
aggregator_save_category in drupal/core/modules/aggregator/aggregator.module
Adds/edits/deletes aggregator categories.
block_update_8005 in drupal/core/modules/block/block.install
Migrate {users}.data into {users_data}.
book_node_predelete in drupal/core/modules/book/book.module
Implements hook_node_predelete().
book_uninstall in drupal/core/modules/book/book.install
Implements hook_uninstall().
comment_node_predelete in drupal/core/modules/comment/comment.module
Implements hook_node_predelete().

... See full list

File

drupal/core/includes/database.inc, line 345
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);
}