我在MySQL數據庫中的註冊程序和它的工作原理是這樣的:LAST_INSERT_ID函數會失敗嗎?
INSERT INTO `tblusers` (`uname`, `upwd`, `umail`) VALUES (RU_UNAME, RU_UPWD, RU_UMAIL);
select LAST_INSERT_ID() into @newuserid;
-- then use the @newuserid to make some work on other tables.
現在我想知道它永遠不會得到錯誤ID專門數據庫將有很多其他表的插入,那麼它可能會得到插入用戶和獲取最後插入的ID之間插入的另一個表的ID?
有沒有失敗的機會?