Definition

update_sql($sql)
drupal/includes/database/database.inc, line 1751

Description

Perform an SQL query and return success or failure.

Parameters

$sql A string containing a complete SQL query. %-substitution parameters are not supported.

Return value

An array containing the keys: success: a boolean indicating whether the query succeeded query: the SQL query executed, passed through check_plain()

Related topics

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

Code

function update_sql($sql) {
  $result = Database::getActiveConnection()->query($sql);
  return array('success' => $result !== FALSE, 'query' => check_plain($sql));
}