Re: int or tinyint
| From: | Hugh Bothwell | Date: | Sun, 31 Mar 2002 19:46:54 +0000 |
| Subject: | Re: int or tinyint | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-18085@lists.php.net to get a copy of this message | ||
> Just a simple question (I think).
>
> When should I use tinyint over int. and what is the difference between the
> two?
MySQL manual section 7.3 (data types):
tinyint (8bit), range is
0 to 255 (unsigned)
-128 to 127 (signed)
int (32bit), range is
0 to 4294967295 (unsigned)
-2147483648 to 2147483647 (signed)
Basically, only use tinyint if you are desperate to
save some space and you know a value will never,
ever be outside its range; otherwise use int.