mysql LAST_INSERT_ID 使用與注意事項

在使用MySQL時,若表中含自增字段(auto_increment類型),則向表中insert一條記錄後,能夠調用last_insert_id()來得到最近insert的那行記錄的自增字段值 $mdb->lastInsertId(); 但事實上,使用last_insert_id()時有不少注意事項,不然很容易踩到坑。 若在同一條insert語句中插入多行(如"insert into tbl_nam
相關文章
相關標籤/搜索