update_sql

  1. drupal
    1. drupal6 database.inc
    2. drupal7
Versionen
drupal6 – drupal7 update_sql($sql)

Perform an SQL query and return success or failure.

Übergabeparameter

$sql A string containing a complete SQL query. %-substitution parameters are not supported.

Rückgabewert

An array containing the keys: success: a boolean indicating whether the query succeeded query: the SQL query executed, passed through check_plain()

Verwandte Themen

▾ 80 functions call update_sql()

addField in includes/database/mysql/schema.inc
addField in includes/database/sqlite/schema.inc
Add a new field to a table.
addField in includes/database/pgsql/schema.inc
Add a new field to a table.
addIndex in includes/database/mysql/schema.inc
addIndex in includes/database/sqlite/schema.inc
Add an index.
addIndex in includes/database/pgsql/schema.inc
Add an index.
addPrimaryKey in includes/database/mysql/schema.inc
addPrimaryKey in includes/database/pgsql/schema.inc
Add a primary key.
addUniqueKey in includes/database/mysql/schema.inc
addUniqueKey in includes/database/sqlite/schema.inc
Add a unique key.
addUniqueKey in includes/database/pgsql/schema.inc
Add a unique key.
alterTable in includes/database/sqlite/schema.inc
Create a table with a new schema containing the old content.
block_update_7000 in modules/block/block.install
Set system.weight to a low value for block module.
book_update_6000 in modules/book/book.install
Drupal 5.x to 6.x update.
changeField in includes/database/mysql/schema.inc
changeField in includes/database/pgsql/schema.inc
Change a field definition.
comment_update_6001 in modules/comment/comment.install
comment_update_7001 in modules/comment/comment.install
Change comment status from published being 0 to being 1
createTable in includes/database/schema.inc
Create a new table from a Drupal table definition.
db_add_column in ./update.php
Add a column to a database using syntax appropriate for PostgreSQL. Save result of SQL commands in $ret array.
db_change_column in ./update.php
Change a column definition using syntax appropriate for PostgreSQL. Save result of SQL commands in $ret array.
dropField in includes/database/mysql/schema.inc
dropField in includes/database/pgsql/schema.inc
Drop a field.
dropIndex in includes/database/mysql/schema.inc
dropIndex in includes/database/sqlite/schema.inc
Drop an index.
dropIndex in includes/database/pgsql/schema.inc
Drop an index.
dropPrimaryKey in includes/database/mysql/schema.inc
dropPrimaryKey in includes/database/pgsql/schema.inc
Drop the primary key.
dropTable in includes/database/mysql/schema.inc
dropTable in includes/database/sqlite/schema.inc
Drop a table.
dropTable in includes/database/pgsql/schema.inc
Drop a table.
dropUniqueKey in includes/database/mysql/schema.inc
dropUniqueKey in includes/database/sqlite/schema.inc
Drop a unique key.
dropUniqueKey in includes/database/pgsql/schema.inc
Drop a unique key.
fieldSetDefault in includes/database/mysql/schema.inc
fieldSetDefault in includes/database/pgsql/schema.inc
Set the default value for a field.
fieldSetNoDefault in includes/database/mysql/schema.inc
fieldSetNoDefault in includes/database/pgsql/schema.inc
Set a field to have no default value.
filter_update_7001 in modules/filter/filter.install
Break out "escape HTML filter" option to its own filter.
hook_update_N in modules/system/system.api.php
Perform a single update. For each patch which requires a database change add a new hook_update_N() which will be called by update.php.
locale_update_6000 in modules/locale/locale.install
{locales_meta} table became {languages}.
locale_update_6001 in modules/locale/locale.install
Change locale column to language. The language column is added by update_fix_d6_requirements() in update.php to avoid a large number of error messages from update.php. All we need to do here is copy locale to language and then drop locale.
locale_update_6002 in modules/locale/locale.install
Remove empty translations, we don't need these anymore.
locale_update_6003 in modules/locale/locale.install
Prune strings with no translations (will be automatically re-registered if still in use)
node_update_7000 in modules/node/node.install
Fix node type 'module' attribute to avoid name-space conflicts.
renameTable in includes/database/mysql/schema.inc
renameTable in includes/database/sqlite/schema.inc
Rename a table.
renameTable in includes/database/pgsql/schema.inc
Rename a table.
system_update_6000 in modules/system/system.install
Remove auto_increment from {boxes} to allow adding custom blocks with visibility settings.
system_update_6005 in modules/system/system.install
Add language to url_alias table and modify indexes.
system_update_6006 in modules/system/system.install
Drop useless indices on node_counter table.
system_update_6007 in modules/system/system.install
Change the severity column in the watchdog table to the new values.
system_update_6008 in modules/system/system.install
Add info files to themes. The info and owner columns are added by update_fix_d6_requirements() in update.php to avoid a large number of error messages from update.php. All we need to do here is copy description to owner and then drop description.
system_update_6009 in modules/system/system.install
The PHP filter is now a separate module.
system_update_6011 in modules/system/system.install
Add language support to nodes
system_update_6015 in modules/system/system.install
Add the form cache table.
system_update_6016 in modules/system/system.install
Make {node}'s primary key be nid, change nid,vid to a unique key. Add primary keys to block, filters, flood, permission, and term_relation.
system_update_6018 in modules/system/system.install
Add HTML corrector to HTML formats or replace the old module if it was in use.
system_update_6019 in modules/system/system.install
Reconcile small differences in the previous, manually created mysql and pgsql schemas so they are the same and can be represented by a single schema structure.
system_update_6021 in modules/system/system.install
Migrate the menu items from the old menu system to the new menu_links table.
system_update_6022 in modules/system/system.install
Update files tables to associate files to a uid by default instead of a nid. Rename file_revisions to upload since it should only be used by the upload module used by upload to link files to nodes.
system_update_6034 in modules/system/system.install
Rename permission "administer access control" to "administer permissions".
system_update_6036 in modules/system/system.install
Change the search schema and indexing.
system_update_6037 in modules/system/system.install
Create consistent empty region for disabled blocks.
system_update_6038 in modules/system/system.install
Ensure that "Account" is not used as a Profile category.
system_update_6039 in modules/system/system.install
Rename permissions "edit foo content" to "edit any foo content". Also update poll module permission "create polls" to "create poll content".
system_update_6041 in modules/system/system.install
Change forum vocabulary not to be required by default and set the weight of the forum.module 1 higher than the taxonomy.module.
system_update_6044 in modules/system/system.install
RC1 to RC2 index cleanup.
system_update_6045 in modules/system/system.install
Update blog, book and locale module permissions.
system_update_6047 in modules/system/system.install
Fix cache mode for blocks inserted in system_install() in fresh installs of previous RC.
system_update_7000 in modules/system/system.install
Rename blog and forum permissions to be consistent with other content types.
system_update_7003 in modules/system/system.install
Update {blocked_ips} with valid IP addresses from {access}.
system_update_7004 in modules/system/system.install
Remove hardcoded numeric deltas from all blocks in core.
system_update_7008 in modules/system/system.install
Use the poll_choice primary key to record votes in poll_votes rather than the choice order. Rename chorder to weight.
system_update_7009 in modules/system/system.install
Rename the variables for primary and secondary links.
system_update_7015 in modules/system/system.install
Change the user logout path.
system_update_7016 in modules/system/system.install
Remove custom datatype *_unsigned in PostgreSQL.
system_update_7021 in modules/system/system.install
Add new blocks to new regions, migrate custom variables to blocks.
system_update_7023 in modules/system/system.install
Change the PHP for settings permission.
update_fix_compatibility in ./update.php
Disable anything in the {system} table that is not compatible with the current version of Drupal core.

Code

includes/database/database.inc, line 2017

<?php
function update_sql($sql) {
  $result = Database::getConnection()->query($sql);
  return array('success' => $result !== FALSE, 'query' => check_plain($sql));
}
?>

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen