[development] db_last_insert_id

Jamie Holly hovercrafter at earthlink.net
Thu Nov 5 00:16:32 UTC 2009


Not for MySQL, but that function needs to be the same for the other 
databases. Look at database.pgsql.inc:

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


Jamie Holly
http://www.intoxination.net 
http://www.hollyit.net



Jeff Greenberg wrote:
> I'm confused with the db_last_insert_id function in 
> database.mysql-common.inc.
>
>
> The function is:
>
>
> function db_last_insert_id($table, $field) {
>   return db_result(db_query('SELECT LAST_INSERT_ID()'));
> }
>
>
> and I see no reason whatsoever for there to be any parameters, let alone 
> required ones.
>
>
>   


More information about the development mailing list