function db_update

You are here

7 db_update($table, array $options = array())
8 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

61 calls to db_update()
AggregatorCronTest::testCron in core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorCronTest.php
Adds feeds and updates them via cron process.
DatabaseStorageTest::update in core/modules/config/lib/Drupal/config/Tests/Storage/DatabaseStorageTest.php
DeleteTest::testInUse in core/modules/file/lib/Drupal/file/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. in core/modules/contact/tests/
Database additions for Drupal\contact\Tests\ContactUpgradePathTest.

... See full list


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


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