Mysql last_insert_id() - help

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
thamizhchelvan
Forum Newbie
Posts: 23
Joined: Tue May 08, 2007 2:50 am

Mysql last_insert_id() - help

Post by thamizhchelvan »

Hi,

Is it possible to get the last_insert_id() in mysql at any time?, means without doing any insertion.

Thanks in advance
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Mysql last_insert_id() - help

Post by Christopher »

You can call the function, but you need to check the documentation to see what the return value is before any insert is done.
(#10850)
Post Reply