Hi,

I have tables in which I use the mysql "AutoIncrement" facility to generate 
a new ID when creating new rows.

What I typically do is to (a) create a new row and then (b) retrieve the 
associated ID directly after this by using the "SELECT ID FROM TABLE_NAME 
WHERE ID IS NULL" method.

Should I really be putting some sort of locking around this to avoid 
obtaining the wrong ID value in high load situations???  If so what locking 
method is recommended?? (a sample code excert would be nice).

Thanks in advance
Greg

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to