mysql sql获取上条插入id,update影响行数

 

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>

 

posted @ 2016-05-23 18:24  君子笑而不语  阅读(2295)  评论(0编辑  收藏  举报