Hi
You should use the following construction:
SELECT LAST_INSERT_ID ();
This will return the last auto-increment value for the current connection.
There is also an API function, and in PHP: mysql_insert_id or something like
this.
Sent: Friday, July 06, 2001 8:43 PM
To: MySQL
Subject: Question
i have designed a system that works on MSSQL but i have decided to port it
over to mysql. One of the problems i have come across is i need to figure
out how to get the autoid back. so just say i insert a record, and MYSQL
gives it the auto id of 6, how do i know that from my VB program?
Jason
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php