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

Returns a new UpdateQuery object for the active database.


$table: The table to update.

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

Return value

\Drupal\Core\Database\Query\Update A new Update object for this connection.

Related topics

55 calls to db_update()
AggregatorCronTest::testCron in core/modules/aggregator/src/Tests/AggregatorCronTest.php
Adds feeds and updates them via cron process.
DatabaseStorageTest::update in core/modules/config/src/Tests/Storage/DatabaseStorageTest.php
DeleteTest::testInUse in core/modules/file/src/Tests/DeleteTest.php
Tries deleting a file that is in use.
drupal-7.all-disabled.database.php in core/modules/system/tests/upgrade/drupal-7.all-disabled.database.php
Database additions for upgrade path tests when all non-required modules are disabled.
drupal-7.contact.database.php in core/modules/contact/tests/drupal-7.contact.database.php
Database additions for Drupal\contact\Tests\ContactUpgradePathTest.

... See full list


core/includes/database.inc, line 382
Core systems for the database layer.


function db_update($table, array $options = array()) {
  if (empty($options ['target']) || $options ['target'] == 'replica') {
    $options ['target'] = 'default';
  return Database::getConnection($options ['target'])->update($table, $options);