I was planning to use mysql_insert_id(), and then I read the note stating that it will not work correctly if the ID datatype is BIGINT (which it is in my case). So I at least know that I have to use LAST_INSERT_ID(), however I am a little worried about using this function because I am not sure how it will act with multiple users connecting to the database at the same time. Is it possible that one user using the site will cause a database insert and then before the LAST_INSERT_ID() function call a second user could cause another insert thus throwing the accuracy of the LAST_INSERT_ID() function call? Is it possible that I have to set up some sort of transaction? If I do have to set up a transaction, how do I do so?
Thanks in advance for the help.
LAST_INSERT_ID() question
Moderator: General Moderators
-
thinsoldier
- Forum Contributor
- Posts: 367
- Joined: Fri Jul 20, 2007 11:29 am
- Contact:
I've always wondered whether it was ok to use one of the other engines. Why do [s]u[/s] you suggest InnoDB? What are it's benefits? Is it your favorite?VladSun wrote:Use InnoDB, not MyISAM storage engine.
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:11. Please use proper, complete spelling when posting in the forums. AOL Speak, leet speak and other abbreviated wording can confuse those that are trying to help you (or those that you are trying to help). Please keep in mind that there are many people from many countries that use our forums to read, post and learn. They do not always speak English as well as some of us, nor do they know these aberrant abbreviations. Therefore, use as few abbreviations as possible, especially when using such simple words.
Some examples of what not to do are ne1, any1 (anyone); u (you); ur (your or you're); 2 (to too); prolly (probably); afaik (as far as I know); etc.