mysql5.1在插入整形类型的数据时,不能在用''号
insert into test(test_int,test_int1) values('1','2');
这条语句是5.0以前版本可用的,现在5.1用不了了,不知道各位高手是否有办法解决。
我不想该代码,应为这样的语句太多了。并且我也只能用5.1。
各位高手用捷径么?还请多多帮忙
insert into test(test_int,test_int1) values('1','2');
这条语句是5.0以前版本可用的,现在5.1用不了了,不知道各位高手是否有办法解决。
我不想该代码,应为这样的语句太多了。并且我也只能用5.1。
各位高手用捷径么?还请多多帮忙
我这里有最新5.1版本的测试,没有任何问题:
D:\mysql-5.1.26-rc-win32\bin>mysql -u test
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 5.1.26-rc-community MySQL Community Server (GPL)Type 'help;' or '\h' for help. Type '\c' to clear the buffer.mysql> show tables;
ERROR 1046 (3D000): No database selected
mysql> use test
Database changed
mysql> show tables;
Empty set (0.00 sec)mysql> create table test(id int, col2 int);
Query OK, 0 rows affected (0.11 sec)mysql> insert into test values('1', '2');
Query OK, 1 row affected (0.03 sec)mysql>
insert into test(test_int,test_int1) values(1,2);
应该是
insert into test(test_int,test_int1) values('1','');
是插入空的字段,以前用''是可以的。5。1现在不行,非要写成NULL.昨天我测试了。并且查了资料,没有办法解决该问题。不过谢谢各位。