I am running some code that INSERTS a user's information (as inputted in a form) into a MySQL table and then immediately runs a second SELECT query to retrieve that same user's 'userID' (unique ID, auto-incremented data type) to use when appearing in the next page.
I think that my page is executing too fast so that by the time it runs the SELECT query, it is still INSERTing from the last query. I know this because when I 'exit()' the page and echo out the 'userID' (from the SELECT query) it does not show until I refresh the page (making it execute the query a second time).
So my question is this ... is there a way to retrieve the unique ID from the INSERT query?
Returning ID
Moderator: General Moderators