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 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. 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
Archived
This topic is now archived and is closed to further replies.