mysql_insert_id(MySQL指令) - 百度百科
mysql_insert_id()返回给定的 link_identifier中上一步 INSERT 查询中产生的 AUTO_INCREMENT 的 ID 号。如果没有指定 link_identifier,则使用上一个打开的连接。详情