How to get the id inserted by Auto increment
Posted: Mon Nov 05, 2012 8:20 pm
Hello,
I have a MySQL database with a product table that auto increments the id when a new item gets inserted.
The insert query is something like this
I want to know what the id is of the latest insert I did.
I'm programming in php.
I can write a search query that searches on product and date,
but there must be a faster and easier way.
I have a MySQL database with a product table that auto increments the id when a new item gets inserted.
The insert query is something like this
Code: Select all
INSERT INTO table (product,date_1) values ('item','$today');
I'm programming in php.
I can write a search query that searches on product and date,
but there must be a faster and easier way.