status int(4) not not default 1;为啥数据库里面有的字段  设计成int(4)啊 之类的??
资料显示这个4只是显示宽度,实际存储的还是4个字节

解决方案 »

  1.   

    你这样写完全没有意义  要加上zerofill才行  只是客户端显示的宽度 和实际存储长度无关mysql> create table test2(a int(20) zerofill);
    Query OK, 0 rows affected (0.01 sec)mysql> insert into test2 select 1;
    Query OK, 1 row affected (0.01 sec)
    Records: 1  Duplicates: 0  Warnings: 0mysql> select * from test2;
    +----------------------+
    | a                    |
    +----------------------+
    | 00000000000000000001 |
    +----------------------+
    1 row in set (0.00 sec)