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 Link to comment https://forums.phpfreaks.com/topic/42280-last-inserted-id-set-as-variable/ Share on other sites More sharing options...
per1os Posted March 11, 2007 Share Posted March 11, 2007 $lastID = mysql_insert_id(); --FrosT Link to comment https://forums.phpfreaks.com/topic/42280-last-inserted-id-set-as-variable/#findComment-205089 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.