Vinze Posted March 24, 2007 Share Posted March 24, 2007 Hey, if I've just created a new entry in a table with ID set to auto_increment, how can I find out the new ID? Is that possible without another query? Link to comment https://forums.phpfreaks.com/topic/44142-solved-how-can-i-find-out-the-id-of-a-just-created-entry/ Share on other sites More sharing options...
paul2463 Posted March 24, 2007 Share Posted March 24, 2007 $lastid = mysql_insert_id(); echo $lastid; // prints out the last autoincremented id Link to comment https://forums.phpfreaks.com/topic/44142-solved-how-can-i-find-out-the-id-of-a-just-created-entry/#findComment-214342 Share on other sites More sharing options...
Vinze Posted March 24, 2007 Author Share Posted March 24, 2007 $lastid = mysql_insert_id(); echo $lastid; // prints out the last autoincremented id Awesome, thanks! Link to comment https://forums.phpfreaks.com/topic/44142-solved-how-can-i-find-out-the-id-of-a-just-created-entry/#findComment-214347 Share on other sites More sharing options...
MadTechie Posted March 25, 2007 Share Posted March 25, 2007 Click Solved Link to comment https://forums.phpfreaks.com/topic/44142-solved-how-can-i-find-out-the-id-of-a-just-created-entry/#findComment-214709 Share on other sites More sharing options...
Vinze Posted March 25, 2007 Author Share Posted March 25, 2007 Click Solved Sorry Link to comment https://forums.phpfreaks.com/topic/44142-solved-how-can-i-find-out-the-id-of-a-just-created-entry/#findComment-214710 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.