|
我新建了一个mysql的数据库wowsk的表,插入一个记录,以上都可以,但是随后更新的时候,sessionid字段始终无法更新。数据库也没有出错,这是为什么呢。
use wowsk;
create table online ( id int not null primary key, name varchar(50), ip varchar(50), pass varchar(50), starttime date, endtime date, online int, logintime date, sessionid int, cardno varchar(50));
insert into online values(1,"marvel",NULL,"liuwenmao","2007-03-02 12:12:1","2007-03-02 12:12:1",0,NULL,0,NULL);
-----------------------------------------------------------------------------------------------
marvel@bm:~/chatserver/c$ mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3313
Server version: 5.0.32-Debian_10-log Debian etch distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> select * from wowsk.online;
+----+--------+------+-----------+------------+------------+--------+-----------+-----------+--------+
| id | name | ip | pass | starttime | endtime | online | logintime | sessionid | cardno |
+----+--------+------+-----------+------------+------------+--------+-----------+-----------+--------+
| 1 | marvel | NULL | liuwenmao | 2007-03-02 | 2007-03-02 | 0 | NULL | 0 | NULL |
+----+--------+------+-----------+------------+------------+--------+-----------+-----------+--------+
1 row in set (0.00 sec)
mysql> update wowsk.online set sessionid=10 where name='marvel';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> select * from wowsk.online;
+----+--------+------+-----------+------------+------------+--------+-----------+-----------+--------+
| id | name | ip | pass | starttime | endtime | online | logintime | sessionid | cardno |
+----+--------+------+-----------+------------+------------+--------+-----------+-----------+--------+
| 1 | marvel | NULL | liuwenmao | 2007-03-02 | 2007-03-02 | 0 | NULL | 0 | NULL |
+----+--------+------+-----------+------------+------------+--------+-----------+-----------+--------+
1 row in set (0.01 sec) |
|