db_insert

  1. drupal
    1. 7
Versions
7 db_insert($table, array $options = array())

Returns a new InsertQuery object for the active database.

Parameters

$table The table into which to insert.

$options An array of options to control how the query operates.

Return value

InsertQuery A new InsertQuery object for this connection.

Related topics

▾ 100 functions call db_insert()

actions_synchronize in drupal/includes/actions.inc
Synchronizes actions that are provided by modules in hook_action_info().
aggregator_categorize_items_submit in drupal/modules/aggregator/aggregator.pages.inc
Process aggregator_categorize_items() form submissions.
aggregator_save_category in drupal/modules/aggregator/aggregator.module
Add/edit/delete aggregator categories.
aggregator_save_feed in drupal/modules/aggregator/aggregator.module
Add/edit/delete an aggregator feed.
aggregator_save_item in drupal/modules/aggregator/aggregator.processor.inc
Add/edit/delete an aggregator item.
batch_process in drupal/includes/form.inc
Processes the batch.
block_add_block_form_submit in drupal/modules/block/block.admin.inc
Form submission handler for the add block form.
block_admin_configure_submit in drupal/modules/block/block.admin.inc
Form submission handler for the block configuration form.
block_update_7004 in drupal/modules/block/block.install
Add new blocks to new regions, migrate custom variables to blocks.
comment_enable in drupal/modules/comment/comment.install
Implements hook_enable().
comment_node_insert in drupal/modules/comment/comment.module
Implements hook_node_insert().
comment_save in drupal/modules/comment/comment.module
Accepts a submission of new or changed comment content.
comment_update_7006 in drupal/modules/comment/comment.install
Migrate data from the comment field to field storage.
contact_install in drupal/modules/contact/contact.install
Implements hook_install().
dbtng_example_entry_insert in examples/dbtng_example/dbtng_example.module
Save an entry in the database.
dbtng_example_install in examples/dbtng_example/dbtng_example.install
Implements hook_install().
DrupalTestCase::insertAssert in drupal/modules/simpletest/drupal_web_test_case.php
Store an assertion from outside the testing context.
drupal_install_system in drupal/includes/install.inc
Callback to install the system module.
drupal_write_record in drupal/includes/common.inc
Saves (inserts or updates) a record to the database based upon the schema.
field_sql_storage_field_storage_write in drupal/modules/field/modules/field_sql_storage/field_sql_storage.module
Implements hook_field_storage_write().
filter_update_7001 in drupal/modules/filter/filter.install
Break out "escape HTML filter" option to its own filter.
filter_update_7003 in drupal/modules/filter/filter.install
Upgrade the {filter} table for core filters.
filter_update_7005 in drupal/modules/filter/filter.install
Integrate text formats with the user permissions system.
flood_register_event in drupal/includes/common.inc
Register an event for the current visitor to the flood control mechanism.
forum_field_storage_pre_insert in drupal/modules/forum/forum.module
Implements hook_field_storage_pre_insert().
forum_field_storage_pre_update in drupal/modules/forum/forum.module
Implements hook_field_storage_pre_update().
forum_node_insert in drupal/modules/forum/forum.module
Implements hook_node_insert().
forum_node_update in drupal/modules/forum/forum.module
Implements hook_node_update().
forum_update_7001 in drupal/modules/forum/forum.install
Create new {forum_index} table.
hook_entity_insert in drupal/modules/system/system.api.php
Act on entities when inserted.
hook_field_insert in drupal/modules/field/field.api.php
Define custom insert behavior for this module's field types.
hook_field_storage_pre_insert in drupal/modules/field/field.api.php
Act before the storage backends insert field data.
hook_field_storage_pre_update in drupal/modules/field/field.api.php
Act before the storage backends update field data.
hook_field_storage_write in drupal/modules/field/field.api.php
Write field data for an entity.
hook_field_update in drupal/modules/field/field.api.php
Define custom update behavior for this module's field types.
hook_insert in drupal/modules/node/node.api.php
Respond to creation of a new node.
hook_install in drupal/modules/system/system.api.php
Perform setup tasks when the module is installed.
hook_node_insert in drupal/modules/node/node.api.php
Respond to creation of a new node.
hook_path_insert in drupal/modules/path/path.api.php
Allow modules to respond to a path being inserted.
hook_taxonomy_term_insert in drupal/modules/taxonomy/taxonomy.api.php
Act on taxonomy terms when inserted.
hook_taxonomy_term_update in drupal/modules/taxonomy/taxonomy.api.php
Act on taxonomy terms when updated.
hook_user_insert in drupal/modules/user/user.api.php
A user account was created.
hook_user_logout in drupal/modules/user/user.api.php
The user just logged out.
hook_user_role_insert in drupal/modules/user/user.api.php
Inform other modules that a user role has been added.
hook_user_update in drupal/modules/user/user.api.php
A user account was updated.
locale in drupal/modules/locale/locale.module
Provides interface translation services.
locale_add_language in drupal/includes/locale.inc
API function to add a language.
locale_install in drupal/modules/locale/locale.install
Implements hook_install().
locale_translate_edit_form_submit in drupal/modules/locale/locale.admin.inc
Process string editing form submissions.
lock_acquire in drupal/includes/lock.inc
Acquire (or renew) a lock, but do not block if it fails.
menu_link_save in drupal/includes/menu.inc
Save a menu link.
minimal_install in drupal/profiles/minimal/minimal.install
Implements hook_install().
nodeapi_example_node_insert in examples/nodeapi_example/nodeapi_example.module
Implements hook_node_insert().
node_access_example_node_insert in examples/node_access_example/node_access_example.module
Implements hook_node_insert().
node_access_rebuild in drupal/modules/node/node.module
Rebuild the node access database. This is occasionally needed by modules that make system-wide changes to access levels.
node_access_write_grants in drupal/modules/node/node.module
Writes a list of grants to the database, deleting any previously saved ones.
node_form_block_admin_configure_submit in drupal/modules/node/node.module
Form submit handler for block configuration form.
node_install in drupal/modules/node/node.install
Implements hook_install().
node_type_save in drupal/modules/node/node.module
Saves a node type to the database.
openid_association in drupal/modules/openid/openid.module
Attempt to create a shared secret with the OpenID Provider.
openid_user_identities in drupal/modules/openid/openid.pages.inc
Menu callback; Manage OpenID identities for the specified user.
openid_verify_assertion_nonce in drupal/modules/openid/openid.module
Verify that the nonce has not been used in earlier assertions from the same OpenID provider.
poll_insert in drupal/modules/poll/poll.module
Implements hook_insert().
poll_vote in drupal/modules/poll/poll.module
Submit handler for processing a vote.
profile_field_form_submit in drupal/modules/profile/profile.admin.inc
Process profile_field_form submissions.
search_index in drupal/modules/search/search.module
Update the full-text search index for a particular item.
simpletest_run_tests in drupal/modules/simpletest/simpletest.module
Actually runs tests.
standard_install in drupal/profiles/standard/standard.install
Implements hook_install().
statistics_exit in drupal/modules/statistics/statistics.module
Implements hook_exit().
SystemQueue::createItem in drupal/modules/system/system.queue.inc
system_block_ip_action in drupal/modules/system/system.module
Blocks the current user's IP address.
system_ip_blocking_form_submit in drupal/modules/system/system.admin.inc
system_update_7003 in drupal/modules/system/system.install
Update {blocked_ips} with valid IP addresses from {access}.
system_update_7007 in drupal/modules/system/system.install
Convert to new method of storing permissions.
system_update_7011 in drupal/modules/system/system.install
Split the 'bypass node access' permission from 'administer nodes'.
system_update_7029 in drupal/modules/system/system.install
Add new 'view own unpublished content' permission for authenticated users. Preserves legacy behavior from Drupal 6.x.
system_update_7036 in drupal/modules/system/system.install
Split the 'access site in maintenance mode' permission from 'administer site configuration'.
system_update_7053 in drupal/modules/system/system.install
Upgrade standard blocks and menus.
system_update_7061 in drupal/modules/system/system.install
Migrate upload.module data to the newly created file field.
system_update_files_database in drupal/modules/system/system.module
Updates the records in the system table based on the files array.
taxonomy_field_insert in drupal/modules/taxonomy/taxonomy.module
Implements hook_field_insert().
taxonomy_field_update in drupal/modules/taxonomy/taxonomy.module
Implements hook_field_update().
taxonomy_term_save in drupal/modules/taxonomy/taxonomy.module
Save a term object to the database.
taxonomy_test_taxonomy_term_insert in drupal/modules/simpletest/tests/taxonomy_test.module
Implements hook_taxonomy_term_insert().
taxonomy_update_7005 in drupal/modules/taxonomy/taxonomy.install
Migrate {taxonomy_term_node} table to field storage.
tracker_cron in drupal/modules/tracker/tracker.module
Implements hook_cron().
trigger_assign_form_submit in drupal/modules/trigger/trigger.admin.inc
Submit function for trigger_assign_form().
update_fix_d7_install_profile in drupal/includes/update.inc
Register the currently installed profile in the system table.
update_fix_d7_requirements in drupal/includes/update.inc
Perform Drupal 6.x to 7.x updates that are required for update.php to function properly.
user_install in drupal/modules/user/user.install
Implements hook_install().
user_save in drupal/modules/user/user.module
Save changes to a user account or add a new user.
_book_update_outline in drupal/modules/book/book.module
Common helper function to handles additions and updates to the book outline.
_locale_import_one_string_db in drupal/includes/locale.inc
Import one string into the database.
_locale_parse_js_file in drupal/includes/locale.inc
Parses a JavaScript file, extracts strings wrapped in Drupal.t() and Drupal.formatPlural() and inserts them into the database.
_menu_router_save in drupal/includes/menu.inc
Helper function to save data from menu_router_build() to the router table.
_registry_parse_file in drupal/includes/registry.inc
Parse a file and save its function and class listings.
_update_7000_field_create_field in drupal/modules/field/field.install
Utility function: create a field by writing directly to the database.
_update_7000_field_create_instance in drupal/modules/field/field.install
Utility function: write a field instance directly to the database.
_update_7000_field_sql_storage_write in drupal/modules/field/modules/field_sql_storage/field_sql_storage.install
Utility function: write field data directly to SQL storage.
_update_create_fetch_task in drupal/modules/update/update.fetch.inc
Add a task to the queue for fetching release history data for a project.

Code

drupal/includes/database/database.inc, line 2294

<?php
function db_insert($table, array $options = array()) {
  if (empty($options['target']) || $options['target'] == 'slave') {
    $options['target'] = 'default';
  }
  return Database::getConnection($options['target'])->insert($table, $options);
}
?>