Page 1 of 1

Returning ID

Posted: Sun Apr 16, 2006 8:34 pm
by AliasBDI
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?

Posted: Sun Apr 16, 2006 8:45 pm
by feyd

Posted: Thu Apr 20, 2006 10:39 am
by AliasBDI
Perfect! Works great! Thanks.