doesn't work.
send back 0 for each row there is in the table

C.

-----Message d'origine-----
De : Alen Milkovic [mailto:[EMAIL PROTECTED]]
Envoyé : lundi 20 août 2001 12:00
À : [EMAIL PROTECTED]
Objet : Ang: [C2] mysql and auto-increment


>>> "Orgalist" <[EMAIL PROTECTED]> 20.08.01 11:54 >>>
>hello,
>I have a mysql database with a table 'listes' which has
>a column 'id' auto increment.
>How can I get the last inserted row's id ?
>(except using select max(id) from .... )
>thanks.

Just use the LAST_INSERT_ID() function.

SELECT LAST_INSERT_ID() will return the latest inserted id.




*****************************************************************
This footnote confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.
*****************************************************************

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to