I'm new to web programming and doing different tutorials that I can find on the net.
I did my research and found out that in int(11), 11 is the maximum display width for integers and it's the default value if unless the integer is UNSIGNED (in this case it's 10).
When I see something like this:
id INT(11) not null AUTO_INCREMENT
I have no questions. But why do I see different things in different tutorials? For examlpe, in some, it says,
id INT(10) not null AUTO_INCREMENT
And even
id INT(4) not null AUTO_INCREMENT
What are the authors of those tuts trying to achieve? None of them seem to bother to give an explanation what 10 or 4 means.
Alright, they're obviously reducing the display width, but why? What's wrong with the default width of 11? Why would they want to change it? Or are there any other reasons I don't know of?
Thanks.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…