From: Tauren Mills Date: March 14 1999 9:39pm Subject: Auto-Increment List-Archive: http://lists.mysql.com/mysql/236 Message-Id: <000a01be6e63$27944a40$1ad7a2d1@yowza.easystreet.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_000B_01BE6E20.19710A40" ------=_NextPart_000_000B_01BE6E20.19710A40 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit After reading the manual, I have a question about Auto-Increment... The manual says that I can use this query to find out the value of the most recent AUTO_INCREMENT field: SELECT * FROM tbl_name WHERE auto_col IS NULL If I use this immediately after inserting a row, am I guaranteed that this will return the value that I just inserted? Or is it possible for another user accessing the same database to insert another row right after my row was inserted, but prior to this Select? To use this correctly, do I need to lock the table prior to the insert and the select? I am doing this from via the twz Java JDBC driver. Is there another simpler approach I can take? I cannot use mysql_insert_id(). Thanks, Tauren ------=_NextPart_000_000B_01BE6E20.19710A40--