At 1:49 -0700 9/20/02, PR wrote: >I have a message board app I'm using where I'm trying to make the code >faster and more efficient than it is now. At times this board will >generate a lot of new posts to it very very quickly. In one section where >posts are added, after the post is made and inserted into mysql, we need to >get the post number, which is an auto-increment field, for the insert just >finished. And then we need to use this to update the boards table with >stuff like last post and then maybe send an email with a link in it, etc.. >I found the last_insert_id section and it looks like this is what I want, >where after I do the insert, I can do something like >mysql> SELECT LAST_INSERT_ID(); > >My questions are: > >If I have something like 500 concurrent users is this a safe and reliable >way to get that info if 50 of them are posting at the same time?
Yes. It does what you want. > >Is there anything that would prevent the select from getting the last id >that I need to watch for such as finish statements, etc... What's a "finish statement"? > >What version did this feature start in so I can make sure we can use it. Way, way, back. There's no chance that your version of MySQL doesn't support it. More specifically, 3.21.11. :-) > >Thanks in advance for any assistance. --------------------------------------------------------------------- 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