1.获取上条插入数据
LAST_INSERT_ID();
2.获取update影响行数。
ROW_COUNT();
mysql> UPDATE t
-> SET address = 'beijing111'
-> WHERE id = 1
-> AND NAME = 'yubowei';
Query OK, 1 row affected (0.30 sec)
Rows matched: 1 Changed: 1 Warnings: 0 mysql>
mysql> SELECT ROW_COUNT();
+-------------+
| ROW_COUNT() |
+-------------+
| 1 |
+-------------+
1 row in set (0.00 sec) mysql>