Hi All,
Please tell how to get last inserted record from the table in PHP,Mysql.
Please reply me.
Thanks,
Roja
Roja,
It is LAST_INSERT_ID().
Common usage case:
INSERT INTO foo (auto,text)
VALUES(NULL,‘text’); # generate ID by inserting NULL
INSERT INTO foo2 (id,text)
VALUES(LAST_INSERT_ID(),‘text’); # use ID in second table
Please see more details in MySQL documentation if needed:
http://dev.mysql.com/doc/refman/5.0/en/getting-unique-id.htm l