Jump to content

[SOLVED] Get the id of item just inserted


rondog

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.