[drupal-support] How to use MySQL last_insert_id function with locking?

KZ Mai junkiebox at gmail.com
Thu Jul 21 07:28:05 UTC 2005


Hi,
I am developing my own module which uses tables that have auto-increment fields.

As far as I can tell, drupal uses a single connection for my default
configuration.

I don't think i think use last_insert_id without locking because the
MySQL DB connection is shared accross requests.

so what should I lock in order to get the correct result from last_insert_id?

Please give me an example.

Thanks.
Kai



More information about the drupal-support mailing list