84669 Lernen von Personen
152542 Lernen von Personen
20005 Lernen von Personen
5487 Lernen von Personen
7821 Lernen von Personen
359900 Lernen von Personen
3350 Lernen von Personen
180660 Lernen von Personen
48569 Lernen von Personen
18603 Lernen von Personen
40936 Lernen von Personen
1549 Lernen von Personen
1183 Lernen von Personen
32909 Lernen von Personen
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 是定长数据类型。所以存储的大小是确定的。不会因为()而变化。
如果是有符号整数就会多出负号占一位
好不好了