调用游标下的lastrowid
可以获取插入之前的表里id字段存放到哪个自增id
cursor.lastrowid
mysql> select * from userinfo; +----+-------+-----+ | id | name | pwd | +----+-------+-----+ | 1 | mike | 123 | | 2 | jack | 456 | | 3 | alex | 555 | | 4 | peter | 989 | | 5 | app | 123 | | 6 | tom | 556 | +----+-------+-----+ 6 rows in set (0.03 sec)