| 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().
$table The name of the table you inserted into.
$field The name of the autoincrement field.
includes/
<?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