Canman2005 Posted March 11, 2007 Share Posted March 11, 2007 Hi all I have a insert script which after it has run, prints the last insered ID, using printf("%d\n", mysql_insert_id()); Is there a way to set this number as a variable? I know that $lastidnumber = printf("%d\n", mysql_insert_id()); Doesnt work, so is there a way to do this? Also, is this the best way to return the last inserted ID? I am using it as a order id number for a small shopping cart. Any help would be great Thanks Dave Quote Link to comment Share on other sites More sharing options...
per1os Posted March 11, 2007 Share Posted March 11, 2007 $lastID = mysql_insert_id(); --FrosT Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.