mysql LAST_INSERT_ID 使用与注意事项

在使用MySQL时,若表中含自增字段(auto_increment类型),则向表中insert一条记录后,能够调用last_insert_id()来得到最近insert的那行记录的自增字段值 $mdb->lastInsertId(); 但事实上,使用last_insert_id()时有不少注意事项,不然很容易踩到坑。 若在同一条insert语句中插入多行(如"insert into tbl_nam
相关文章
相关标签/搜索