db_last_insert_id

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

Returns the last insert id.

@todo Remove this function when all queries have been ported to db_insert().

Übergabeparameter

$table The name of the table you inserted into.

$field The name of the autoincrement field.

Verwandte Themen

Code

includes/database/database.inc, line 2551

<?php
function db_last_insert_id($table, $field) {
  $sequence_name = Database::getConnection()->makeSequenceName($table, $field);
  return Database::getConnection()->lastInsertId($sequence_name);
}
?>

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