mysql取得最后插入的id

方法1:
SELECT @@session.identity;
查当前会话的最后插入 id,不受其它会话干扰
方法2:
SELECT LAST_INSERT_ID();
php方法:
int mysql_insert_id( [resource link_identifier] )

Leave a Reply

Your email address will not be published. Required fields are marked *