View Single Post
Old 12-01-2007, 09:02 PM   #12 (permalink)
SOCK
The Acquainted
 
Join Date: Nov 2007
Posts: 154
Thanks: 31
SOCK is on a distinguished road
Default

Incidentally, you can often solve an odd problem like this by using straight SQL, e.g.

(using SQL to retrieve the ID value and store as a variable)
Code:
SELECT @last_id:= LAST_INSERT_ID();
Now whenever you need to retrieve that value or use it within an SQL statement (all within the same login session, e.g. same script execution of course), just refer to it using the MySQL variable @last_id. Several calls to mysql_query() later it will still be the same value.
SOCK is offline  
Reply With Quote