webref.eu Posted June 2, 2009 Share Posted June 2, 2009 Hi All I add products to my database, and allow auto increment to assign the ProductId as follows: Once the script has successfully added the product, I then immediately need the script to retrieve its ProductId, so what's the best way of doing that? Many thanks Link to comment https://forums.phpfreaks.com/topic/160650-solved-get-last-added-id-from-database/ Share on other sites More sharing options...
jxrd Posted June 2, 2009 Share Posted June 2, 2009 If mysql: http://uk.php.net/mysql_insert_id Link to comment https://forums.phpfreaks.com/topic/160650-solved-get-last-added-id-from-database/#findComment-847810 Share on other sites More sharing options...
webref.eu Posted June 2, 2009 Author Share Posted June 2, 2009 That's great, thanks very much. Rgds Link to comment https://forums.phpfreaks.com/topic/160650-solved-get-last-added-id-from-database/#findComment-847900 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.