function db_delete

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

Returns a new DeleteQuery object for the active database.


$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


drupal/core/includes/, line 345
Core systems for the database layer.


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