I read so many SO posts still I didn't get the point.
I have created a temp table to test my doubt.
create table ids(id int(1));
I used to think that if I specify int(1)
, then I can store only 0-9
. So I tried the following
insert into ids(id) values(100000);
It works!! Then I started my search to understand the number. In all the posts, I read that number near by data type means width
. I still don't get the term width in mysql
. Does they mean size? If so, size in bytes?.
And If I want to achieve what I thought, what should I change in my query? or Should I limit this from my php code?
Does this width mean same to all datatype?