limitphp Posted February 12, 2009 Share Posted February 12, 2009 I need to insert a record: mysql_query("INSERT INTO playlists (name, userID) VALUES ('$playlistName','$userID')") or die (mysql_error()); and then I need to insert another record that will contain the ID from the newly created record I just added. How do I grab a column value from the row I just created? thanks Quote Link to comment https://forums.phpfreaks.com/topic/144939-solved-grab-value-from-a-newly-inserted-record/ Share on other sites More sharing options...
premiso Posted February 12, 2009 Share Posted February 12, 2009 For the id newly created mysql_insert_id should do the trick. Quote Link to comment https://forums.phpfreaks.com/topic/144939-solved-grab-value-from-a-newly-inserted-record/#findComment-760568 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.