By LeeMcL on
I am looking for a Drupal database neutral alternative to mysql_insert_id that has good performance. I looked at db_next_id but on MySQL it involves four queries and a database lock/unlock.
There were various discussions in these forums about alternatives in particular:
But the patch proposed by chx seems to be on hold till Drupal 5 comes out.
I suppose I could code up something for my particular module for postgresql using the notes here:
http://www.postgresql.org/docs/faqs.FAQ.html#item4.11.1
but that seems a poor alternative.
I'm just hoping there is some solution I've missed.
Lee
Comments
db_last_insert_id is the answer
Please check out http://api.drupal.org/api/drupal/includes--database.pgsql.inc/function/d... in this case.
- Mittal Patel
http://www.MittalPatel.co.in
http://www.TriCoreITSolutions.com