Page 1 of 1

Question about INT

Posted: Mon Sep 04, 2006 9:02 pm
by Dale
Ok, lets say i'm using one table in my database called hits and it's an INT(11), and everytime someone visits a page it adds a 1 to that entry... how far up can a INT(11) value go?

Also what's BIG_INT ??

Posted: Mon Sep 04, 2006 9:09 pm
by feyd
http://dev.mysql.com/doc/refman/4.1/en/ ... types.html

The 11 is how many characters it can use. Unsigned maximum on an INT type is 10, while unsigned is 11. Why? The negative sign.

Posted: Mon Sep 04, 2006 9:18 pm
by Dale
feyd wrote:http://dev.mysql.com/doc/refman/4.1/en/ ... types.html

The 11 is how many characters it can use. Unsigned maximum on an INT type is 10, while unsigned is 11. Why? The negative sign.
Thanks for the link.

Why? Well I'm having a wonderful idea for something, that might take off and just needed to know how far an INT would go upto 'hit' wise. Thank you anyways. :)

"The negative sign" ?? What neg sign?

Posted: Mon Sep 04, 2006 9:49 pm
by feyd
Signed integers can be negative. Unsigned cannot. If the number you are dealing with cannot be negative, set the column unsigned to effectively double your available number range. UNSIGNED INT(10) has a range of zero to 4,294,967,295. INT(11) has a range of -2,147,483,648 to 2,147,483,647. It's technically the same number of combinations, just one can do negatives.