bennyboywonder Posted March 7, 2007 Share Posted March 7, 2007 currently I use the SQL statement $query = "INSERT INTO items (user, refId, itemType, itemName) VALUES ('$sessUser', $maincat, 4, '$name')"; to add certain items to my database. In this table, their is an auto_incrementing primary key. Is their a way of having this same sql statement also return the primary key for the row that the data is placed into? Quote Link to comment https://forums.phpfreaks.com/topic/41605-solved-getting-auto_incremented-id/ Share on other sites More sharing options...
bennyboywonder Posted March 7, 2007 Author Share Posted March 7, 2007 never mind. found it... Quote Link to comment https://forums.phpfreaks.com/topic/41605-solved-getting-auto_incremented-id/#findComment-201586 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.