function update_sql
6.x database.inc | update_sql($sql) |
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
62 calls to update_sql()
- book_update_6000 in drupal-6.x/
modules/ book/ book.install - Drupal 5.x to 6.x update.
- comment_update_6001 in drupal-6.x/
modules/ comment/ comment.install - db_add_column in drupal-6.x/
update.php - Add a column to a database using syntax appropriate for PostgreSQL. Save result of SQL commands in $ret array.
- db_add_field in drupal-6.x/
includes/ database.pgsql.inc - Add a new field to a table.
- db_add_field in drupal-6.x/
includes/ database.mysql-common.inc - Add a new field to a table.
1 string reference to 'update_sql'
- drupal_error_handler in drupal-6.x/
includes/ common.inc - Log errors as defined by administrator.
File
- drupal-6.x/
includes/ database.inc, line 63 - Wrapper for database interface code.
Code
function update_sql($sql) {
$result = db_query($sql, true);
return array('success' => $result !== FALSE, 'query' => check_plain($sql));
}