Index: update.php =================================================================== RCS file: /cvs/drupal/drupal/update.php,v retrieving revision 1.205 diff -u -p -r1.205 update.php --- update.php 2 Oct 2006 11:36:17 -0000 1.205 +++ update.php 4 Dec 2006 19:14:07 -0000 @@ -17,10 +17,27 @@ // Enforce access checking? $access_check = TRUE; +/** + * Wrapper function around db_query which returns the query and whether or + * not it was successful. + * + * @param $query + * A string containing an SQL query. + * @param ... + * A variable number of arguments which are substituted into the query + * using printf() syntax. Instead of a variable number of query arguments, + * you may also pass a single array containing the query arguments. See + * db_query for more information. + * + * @return + * An array with keys 'success' and 'query' to be used in determining + * whether the given update query was executed successfully. + */ +function update_sql($query) { + $args = func_get_args(); + $result = db_query($query, $args); -function update_sql($sql) { - $result = db_query($sql); - return array('success' => $result !== FALSE, 'query' => check_plain($sql)); + return array('success' => $result !== FALSE, 'query' => check_plain($query)); } /**