db_last_insert_id
- Versions
- 6
db_last_insert_id($table, $field)
Returns the last insert id. This function is thread safe.
Parameters
$table The name of the table you inserted into.
$field The name of the autoincrement field.
Related topics
Code
includes/database.pgsql.inc, line 230
<?php
function db_last_insert_id($table, $field) {
return db_result(db_query("SELECT CURRVAL('{". db_escape_table($table) ."}_". db_escape_table($field) ."_seq')"));
}
?>Login or register to post comments 