| Versionen | |
|---|---|
| drupal6 – drupal7 | update_sql($sql) |
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()
includes/
<?php
function update_sql($sql) {
$result = db_query($sql, true);
return array('success' => $result !== FALSE, 'query' => check_plain($sql));
}
?>
Kommentare
Kommentar hinzufügen