84669 personnes étudient
152542 personnes étudient
20005 personnes étudient
5487 personnes étudient
7821 personnes étudient
359900 personnes étudient
3350 personnes étudient
180660 personnes étudient
48569 personnes étudient
18603 personnes étudient
40936 personnes étudient
1549 personnes étudient
1183 personnes étudient
32909 personnes étudient
MySQL int 类型不是最多只能到 4,294,967,295 么,怎么新建表的时候,默认不写 int 后面的数字(即不这样写int(5)),建好表之后会是 int(11)
小伙看你根骨奇佳,潜力无限,来学PHP伐。
后面的数字只影响默认显示的位数
http://www.ccvita.com/175.html
举个例子最明白,类似于位数不足以0补全。 e.g.
mysql> create table joke (a int(11)); Query OK, 0 rows affected (0.01 sec)
mysql> insert into joke values(100); Query OK, 1 row affected (0.00 sec)
mysql> select * from joke; +------+ | a | +------+ | 100 | +------+ 1 row in set (0.00 sec)
mysql> alter table joke change a a int(11) zerofill; Query OK, 1 row affected (0.00 sec) Records: 1 Duplicates: 0 Warnings: 0
mysql> select * from joke; +-------------+ | a | +-------------+ | 00000000100 | +-------------+ 1 row in set (0.00 sec)
int(11)这里不是代表的数字最大上限位数的意思,而是数字显示位数,比如 123,在int(11)中会显示成 00000000123
123
00000000123
建表的时候可以不指定int的长度,这个()里面显示的是对外显示的宽度,Int 是定长数据类型。所以存储的大小是确定的。不会因为()而变化。
如果是有符号整数就会多出负号占一位
好不好了
后面的数字只影响默认显示的位数
http://www.ccvita.com/175.html
举个例子最明白,类似于位数不足以0补全。
e.g.
mysql> create table joke (a int(11));
Query OK, 0 rows affected (0.01 sec)
mysql> insert into joke values(100);
Query OK, 1 row affected (0.00 sec)
mysql> select * from joke;
+------+
| a |
+------+
| 100 |
+------+
1 row in set (0.00 sec)
mysql> alter table joke change a a int(11) zerofill;
Query OK, 1 row affected (0.00 sec)
Records: 1 Duplicates: 0 Warnings: 0
mysql> select * from joke;
+-------------+
| a |
+-------------+
| 00000000100 |
+-------------+
1 row in set (0.00 sec)
int(11)这里不是代表的数字最大上限位数的意思,而是数字显示位数,比如
123
,在int(11)中会显示成00000000123
建表的时候可以不指定int的长度,这个()里面显示的是对外显示的宽度,Int 是定长数据类型。所以存储的大小是确定的。不会因为()而变化。
如果是有符号整数就会多出负号占一位
好不好了