Re: how obtain last id past insert?

From: Date: Thu, 20 Nov 2003 18:13:54 +0000
Subject: Re: how obtain last id past insert?
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-31669@lists.php.net to get a copy of this message
depends which DB your using in mysql its "select last_insert_id()" and in mssql for example its "select @identity" have fun Pete Webmaster D.G.R.E.R. wrote:
Hi:
    How i obtain inmediatly the id of last insert ?
    For example i have a forum, when the user post a question, i send a mail
to administrator, but i want to refer the id from this insert, how i do this ?
    Well i think to make a select max(id) inmediatly but i beliebe that must
have any colision from other user that post other question.
    Thank you.


« previous php.db (#31669) next »