Same name and namespace in other branches
  1. 8.9.x core/includes/database.inc \db_delete()

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

86 calls to db_delete()
book_node_delete in modules/book/book.module
Implements hook_node_delete().
BootstrapGetFilenameWebTestCase::testDrupalGetFilename in modules/simpletest/tests/bootstrap.test
Test that drupal_get_filename() works correctly with a full Drupal site.
CommentInterfaceTest::setEnvironment in modules/comment/comment.test
Re-configures the environment, module settings, and user permissions.
comment_delete_multiple in modules/comment/comment.module
Delete comments and all their replies.
comment_node_delete in modules/comment/comment.module
Implements hook_node_delete().

... See full list

File

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