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 widt
From the docs:
"This optional display width may be used by applications to display integer values having a width less than the width specified for the column by left-padding them with spaces. (That is, this width is present in the metadata returned with result sets. Whether it is used or not is up to the application.)" That is, int(4) is politely asking that 123 be displayed as " 123". Don't know how many things actually pay attention or why they'd bother in a tutorial.
"The display width does not constrain the range of values that can be stored in the column. Nor does it prevent values wider than the column display width from being displayed correctly." So if you shove 123456 into an int(4) it will still be 123456.
Nothing to do with disk space or performance, just a hint to the application retrieving the data that it would like to be displayed with at least N digits.
The related ZEROFILL option can be used in conjunction to actually pad out the returned data. So 123 in an int(4) ZEROFILL is returned as 0123.