db_last_insert_id

  1. drupal
    1. drupal6 database.mysql-common.inc
    2. drupal6
    3. drupal7 database.inc
Versionen
drupal6 – drupal7 db_last_insert_id($table, $field)

Returns the last insert id. This function is thread safe.

Übergabeparameter

$table The name of the table you inserted into.

$field The name of the autoincrement field.

Verwandte Themen

▾ 11 functions call db_last_insert_id()

actions_save in includes/actions.inc
Save an action and its associated user-supplied parameter values to the database.
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.module
Add/edit/delete an aggregator item.
batch_process in includes/form.inc
Processes the batch.
block_add_block_form_submit in modules/block/block.admin.inc
Save the new custom block.
comment_save in modules/comment/comment.module
Accepts a submission of new or changed comment content.
drupal_write_record in includes/common.inc
Save a record to the database based upon the schema.
menu_link_save in includes/menu.inc
Save a menu link.
system_install in modules/system/system.install
Implementation of hook_install().
user_save in modules/user/user.module
Save changes to a user account or add a new user.

Code

includes/database.pgsql.inc, line 231

<?php
function db_last_insert_id($table, $field) {
  return db_result(db_query("SELECT CURRVAL('{" . db_escape_table($table) . "}_" . db_escape_table($field) . "_seq')"));
}
?>

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