Hi,

Your query was understood as - you want to retrieve the current value of the autoincrement column, where mysql_insert_id also reveals the same.

Try either of this.

Use LIMIT:

   select  ID from tablename
   order by ID DESC
   LIMIT 1.
or
Use MAX()

 select MAX(ID) from tablename

Thanks
ViSolve DB Team.

----- Original Message ----- From: "Michael Stearne" <[EMAIL PROTECTED]>
To: <mysql@lists.mysql.com>
Cc: "Jim Ginn" <[EMAIL PROTECTED]>
Sent: Tuesday, September 19, 2006 10:11 PM
Subject: Last Inserted ID Using LOAD DATA


I have a group of updates that need to be done using LOAD DATA INFILE.
Within this file there are some INSERTS.  Is there anyway that after
an INSERT happens I can use the auto-increment ID that was just
generated in the next statement.  Similar to PHP's mysql_insert_id()
function.

Thanks,
Michael

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to