db_update

Definition

db_update($table, Array $options = array())
drupal/includes/database/database.inc, line 1658

Description

Returns a new UpdateQuery object for the active database.

Parameters

$table The table to update.

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

Return value

A new UpdateQuery object for this connection.

Related topics

Namesort iconDescription
Database abstraction layerAllow the use of different database servers using the same code base.

Code

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