Date: 12/02/04 (MySQL Communtiy) Keywords: php, mysql, database, sql Hi guys, i'm a newbie to MYSQL, so excuse me for stupid questions :) +====+============+ | ID | SOME_VALUE | +====+============+ | 10 | MY_VALUE | +----+------------+ | | | +----+------------+ID - is auto_increment I use php and make MYSQL query to insert a new row (INSERT query) Is there any way to know inserted row ID? ----------------------- PS. If i use (1) INSERT INTO ... ... ... VALUES ... ... ...; (2) SELECT LAST_INSERT_ID(); can i be 100% sure that another INSERT query (from another user) won't be inserted between (1) and (2) and the returned ID will be wrong? Source: http://www.livejournal.com/community/mysql/43111.html
|