update_sql
Definition
update_sql($sql)
includes/database/database.inc, line 1357
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
| Name | Description |
|---|---|
| Database abstraction layer | Allow the use of different database servers using the same code base. |
Code
<?php
function update_sql($sql) {
$result = Database::getActiveConnection()->query($sql/*, array(true)*/);
return array('success' => $result !== FALSE, 'query' => check_plain($sql));
}
?> 