db_insert

  1. drupal
    1. drupal7
Versionen
drupal7 db_insert($table, array $options = array())

Returns a new InsertQuery object for the active database.

Übergabeparameter

$table The table into which to insert.

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

Rückgabewert

A new InsertQuery object for this connection.

Verwandte Themen

▾ 82 functions call db_insert()

actions_save in includes/actions.inc
Save an action and its associated user-supplied parameter values to the database.
actions_synchronize in includes/actions.inc
Synchronize actions that are provided by modules.
aggregator_categorize_items_submit in modules/aggregator/aggregator.pages.inc
Process aggregator_categorize_items() form submissions.
aggregator_save_category in modules/aggregator/aggregator.module
Add/edit/delete aggregator categories.
aggregator_save_feed in modules/aggregator/aggregator.module
Add/edit/delete an aggregator feed.
aggregator_save_item in modules/aggregator/aggregator.processor.inc
Add/edit/delete an aggregator item.
assert in modules/simpletest/drupal_web_test_case.php
Internal helper: stores the assert.
batch_process in includes/form.inc
Process the batch.
CategorizeFeedItemTestCase::testCategorizeFeedItem in modules/aggregator/aggregator.test
If a feed has a category, make sure that the children inherit that categorization.
claimItem in modules/system/system.queue.inc
comment_node_insert in modules/comment/comment.module
Implementation of hook_node_insert().
comment_save in modules/comment/comment.module
Accepts a submission of new or changed comment content.
DatabaseInsertDefaultsTestCase::testDefaultEmptyInsert in modules/simpletest/tests/database_test.test
Test that no action will be preformed if no fields are specified.
DatabaseInsertDefaultsTestCase::testDefaultInsert in modules/simpletest/tests/database_test.test
Test that we can run a query that is "default values for everything".
DatabaseInsertDefaultsTestCase::testDefaultInsertWithFields in modules/simpletest/tests/database_test.test
Test that we can insert fields with values and defaults in the same query.
DatabaseInsertLOBTestCase::testInsertMultipleBlob in modules/simpletest/tests/database_test.test
Test that we can insert multiple blob fields in the same query.
DatabaseInsertLOBTestCase::testInsertOneBlob in modules/simpletest/tests/database_test.test
Test that we can insert a single blob field successfully.
DatabaseInsertTestCase::testInsertFieldOnlyDefinintion in modules/simpletest/tests/database_test.test
Test that we can specify fields without values and specify values later.
DatabaseInsertTestCase::testInsertLastInsertID in modules/simpletest/tests/database_test.test
Test that inserts return the proper auto-increment ID.
DatabaseInsertTestCase::testMultiInsert in modules/simpletest/tests/database_test.test
Test that we can insert multiple records in one query object.
DatabaseInsertTestCase::testRepeatedInsert in modules/simpletest/tests/database_test.test
Test that an insert object can be reused with new data after it executes.
DatabaseInsertTestCase::testSimpleInsert in modules/simpletest/tests/database_test.test
Test the very basic insert functionality.
DatabaseInvalidDataTestCase::testInsertDuplicateData in modules/simpletest/tests/database_test.test
Traditional SQL database systems abort inserts when invalid data is encountered.
DatabaseRegressionTestCase::testRegression_310447 in modules/simpletest/tests/database_test.test
Regression test for #310447.
DatabaseTestCase::addSampleData in modules/simpletest/tests/database_test.test
Setup our sample data.
DatabaseTestCase::ensureSampleDataNull in modules/simpletest/tests/database_test.test
Set up tables for NULL handling.
DatabaseTransactionTestCase::transactionInnerLayer in modules/simpletest/tests/database_test.test
Helper method for transaction unit tests. This "inner layer" transaction is either used alone or nested inside of the "outer layer" transaction.
DatabaseTransactionTestCase::transactionOuterLayer in modules/simpletest/tests/database_test.test
Helper method for transaction unit test. This "outer layer" transaction starts and then encapsulates the "inner layer" transaction. This nesting is used to evaluate whether the the database transaction API properly supports…
DatabaseUpdateLOBTestCase::testUpdateMultipleBlob in modules/simpletest/tests/database_test.test
Confirm that we can update two blob columns in the same table.
DatabaseUpdateLOBTestCase::testUpdateOneBlob in modules/simpletest/tests/database_test.test
Confirm that we can update a blob column.
default_profile_tasks in profiles/default/default.profile
Perform any final installation tasks for this profile.
drupal_install_system in includes/install.inc
Callback to install the system module.
drupal_write_record in includes/common.inc
Save a record to the database based upon the schema.
expert_profile_tasks in profiles/expert/expert.profile
Perform any final installation tasks for this profile.
FieldSqlStorageTestCase::testFieldAttachLoad in modules/field/modules/field_sql_storage/field_sql_storage.test
Uses the mysql tables and records to verify field_load_revision works correctly.
field_sql_storage_field_storage_write in modules/field/modules/field_sql_storage/field_sql_storage.module
Implementation of hook_field_storage_write().
flood_register_event in includes/common.inc
Register an event for the current visitor (hostname/IP) to the flood control mechanism.
hook_node_insert in modules/node/node.api.php
Respond to node insertion.
hook_taxonomy_term_insert in modules/taxonomy/taxonomy.api.php
Act on taxonomy terms when inserted.
hook_taxonomy_term_update in modules/taxonomy/taxonomy.api.php
Act on taxonomy terms when updated.
ImportOPMLTestCase::openImportForm in modules/aggregator/aggregator.test
Open OPML import form.
ImportOPMLTestCase::submitImportForm in modules/aggregator/aggregator.test
Submit form with invalid, empty and valid OPML files.
locale_add_language in includes/locale.inc
API function to add a language.
locale_translate_edit_form_submit in includes/locale.inc
Process string editing form submissions.
menu_edit_menu_submit in modules/menu/menu.admin.inc
Submit function for adding or editing a custom menu.
menu_install in modules/menu/menu.install
Implementation of hook_install().
menu_link_save in includes/menu.inc
Save a menu link.
module_rebuild_cache in includes/module.inc
Rebuild the database cache of module files.
node_access_rebuild in 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 modules/node/node.module
This function will write a list of grants to the database, deleting any pre-existing grants. If a realm is provided, it will only delete grants from that realm, but it will always delete a grant from the 'all' realm. Modules which utilize…
node_type_save in modules/node/node.module
Saves a node type to the database.
openid_association in modules/openid/openid.module
Attempt to create a shared secret with the OpenID Provider.
openid_user_identities in modules/openid/openid.pages.inc
Menu callback; Manage OpenID identities for the specified user.
path_set_alias in modules/path/path.module
Set an aliased path for a given Drupal path, preventing duplicates.
php_install in modules/php/php.install
Implementation of hook_install().
poll_insert in modules/poll/poll.module
Implementation of hook_insert().
poll_vote in modules/poll/poll.module
Submit handler for processing a vote
profile_field_form_submit in modules/profile/profile.admin.inc
Process profile_field_form submissions.
simpletest_run_tests in modules/simpletest/simpletest.module
Actually runs tests.
StatisticsBlockVisitorsTestCase::setUp in modules/statistics/statistics.test
statistics_exit in modules/statistics/statistics.module
Implementation of hook_exit().
system_block_ip_action in modules/system/system.module
Implementation of a Drupal action. Blocks the user's IP address.
system_ip_blocking_form_submit in modules/system/system.admin.inc
system_theme_data in modules/system/system.module
Collect data about all currently available themes.
system_update_7007 in modules/system/system.install
Convert to new method of storing permissions.
system_update_7011 in modules/system/system.install
Split the 'bypass node access' permission from 'administer nodes'.
system_update_7021 in modules/system/system.install
Add new blocks to new regions, migrate custom variables to blocks.
taxonomy_node_save in modules/taxonomy/taxonomy.module
Save term associations for a given node.
taxonomy_term_save in modules/taxonomy/taxonomy.module
Save a term object to the database.
taxonomy_test_taxonomy_term_insert in modules/simpletest/tests/taxonomy_test.module
Implementation of hook_taxonomy_term_insert().
taxonomy_test_taxonomy_term_update in modules/simpletest/tests/taxonomy_test.module
Implementation of hook_taxonomy_term_update().
taxonomy_vocabulary_save in modules/taxonomy/taxonomy.module
Save a vocabulary given a vocabulary object.
upload_save in modules/upload/upload.module
UserBlocksUnitTests::insertSession in modules/user/user.test
Insert a user session into the {sessions} table. This function is used since we cannot log in more than one user at the same time in tests.
user_admin_perm_submit in modules/user/user.admin.inc
Save permissions selected on the administer permissions page.
user_admin_role_submit in modules/user/user.admin.inc
user_save in modules/user/user.module
Save changes to a user account or add a new user.
_book_update_outline in modules/book/book.module
Common helper function to handles additions and updates to the book outline.
_field_sql_storage_etid in modules/field/modules/field_sql_storage/field_sql_storage.module
Retrieve or assign an entity type id for an object type.
_locale_import_one_string_db in includes/locale.inc
Import one string into the database.
_locale_parse_js_file in 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 includes/menu.inc
Helper function to save data from menu_router_build() to the router table.

Code

includes/database/database.inc, line 1852

<?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);
}
?>

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