I am creating a database, and to get an invoice number, I insert a blank row, use mysql_insert_id() to get the id number, and then update that row after getting all the information i need. Is there any danger of two people ordering off the site at once and mysql_insert_id selecting the wrong id?
I've never run into any issues with mysql_insert_id() not providing me with the latest id.
If you're worried about it though, you could always create another field for the IP address or the like and then select the max id off of the table that matches the same ip.
as I said I use mysql_insert_id() and have never had an issue. I've used the scenario I described above for mssql queries though and it worked flawlessly as well.