At 6:45 PM -0500 9/30/01, Reuben D Budiardja wrote:
>I am a newbie in MySQL. I use an auto_increment to insert to one of the
>column. How do I get the value inserted?
>The documentation seems to suggest using mysql_insert_id() function. But when
>I tried to call it using
>Select mysql_insert_id() from TABLE_NAME
mysql_insert_id() is the C API function for obtaining that value.
Use LAST_INSERT_ID() instead:
You don't want "SELECT LAST_INSERT_ID() from TABLE_NAME", probably.
That will give you the insert-id value once for each row in TABLE_NAME.
>gives me error. I tried to find something in the doc, but it does not really
>Thanks in advance.
>Reuben D. Budiardja
Paul DuBois, paul@stripped