LMSouq
database Open

PHP/MySQL insert row then get 'id'

HI
Hintswen
1 month ago
3 views
Problem Description
The 'id' field of my table auto increases when I insert a row. I want to insert a row and then get that ID. I would do it just as I said it, but is there a way I can do it without worrying about the time between inserting the row and getting the id? I know I can query the database for the row that matches the information that was entered, but there is a high change there will be duplicates, with the only difference being the id.

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base