db_merge

Definition

db_merge($table, array $options = array())
drupal/includes/database/database.inc, line 1709

Description

Returns a new MergeQuery object for the active database.

Parameters

$table The table into which to merge.

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

Return value

A new MergeQuery 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_merge($table, array $options = array()) {
  if (empty($options['target']) || $options['target'] == 'slave') {
    $options['target'] = 'default';
  }
  return Database::getActiveConnection($options['target'])->merge($table, $options);
}