update_sql($sql)
drupal/includes/database/database.inc, line 1751
Perform an SQL query and return success or failure.
$sql A string containing a complete SQL query. %-substitution parameters are not supported.
An array containing the keys: success: a boolean indicating whether the query succeeded query: the SQL query executed, passed through check_plain()
| Name | Description |
|---|---|
| Database abstraction layer | Allow the use of different database servers using the same code base. |
function update_sql($sql) {
$result = Database::getActiveConnection()->query($sql);
return array('success' => $result !== FALSE, 'query' => check_plain($sql));
}