rondog Posted February 13, 2009 Share Posted February 13, 2009 I am running a query that inserts a new row in the DB. How can I get id (not the user_id I just inserted) of the newly created row? I was thinking just doing: SELECT id FROM playlists WHERE title = 'the title I just inserted' That could work, but their is a chance a user would have the same title as another user. Any suggestions? Link to comment https://forums.phpfreaks.com/topic/145112-solved-get-the-id-of-item-just-inserted/ Share on other sites More sharing options...
printf Posted February 13, 2009 Share Posted February 13, 2009 mysql_insert_id Link to comment https://forums.phpfreaks.com/topic/145112-solved-get-the-id-of-item-just-inserted/#findComment-761590 Share on other sites More sharing options...
rondog Posted February 13, 2009 Author Share Posted February 13, 2009 ah perfect! Link to comment https://forums.phpfreaks.com/topic/145112-solved-get-the-id-of-item-just-inserted/#findComment-761591 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.