PDA

View Full Version : quickie on coulmn type int


whackaxe
07-02-2003, 08:26 PM
if i use int(20) will that mean that i will have a maximum number 20 in that field or a maximum of 20 digits?

Galdo
07-02-2003, 08:37 PM
Maximum 20 digits, so up to 99999999999999999999 I guess :D

raf
07-02-2003, 08:45 PM
probably not important but int(20) is probably useless, since

" The signed range is -2147483648 to 2147483647. The unsigned range is 0 to 4294967295." dxit mysql.com

whackaxe
07-03-2003, 11:39 AM
unsigned meaning putting int() without any arguments?

raf
07-03-2003, 11:57 AM
Unsigned as in "all values are positive" You know, without a sign (- or +) in front of it.

So if you have INT() UNSIGNED
your values can go from 0 --> 4294967295 if you have INT()
your values can go from -2147483648 to 2147483647
if you have INT(5)
? i don't know. Probably you can find a site where they keep a list of all possible valueranges for all column-types but i don't know of one. I just use tinyint(), smallint(), mediumint()
http://www.mysql.com/doc/en/Column_types.html