Hi, Is it possible to get the last_insert_id() in mysql at any time?, means without doing any insertion. Thanks in advance tamilsoft
It should be. It returns the key for the last inserted record. I think you do need to specify the table that you would like the id from though.
No, it is not possible. last_insert_id() returns the latest automatically generated value while doing a new insert using the current connection otherwise it returns 0.