On 3/27/01 10:08 AM, "Cal Evans" <[EMAIL PROTECTED]> wrote:

> yep. That's the point of a tinyint, it only holds numbers 0-127.  if you
> need more then try smallint, int or bigint. (and please read the manual
> regarding data types. It's clearly explained there.)
> 
> Cal
> http://www.calevans.com
> 
> 
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Dacian Herbei
> Sent: Tuesday, March 27, 2001 11:50 AM
> To: [EMAIL PROTECTED]
> Subject: tinyint issue
> 
> 
> 
>   Hi,
>   I wonder if anyone had a problem like this one.
>   I have created a table with one field autoincrement. The field is
> tinyint(4).
>   whenever I try to introduce more then 127 records it refuses to
> introduce them.
>   I tried with tinyint(5) 6.. and so on. It works only with integer.
>   dacian
> 
If you aren't putting more than 256 items into the table, then you could
define the column as tinyint unsigned.  Stating tinyint(4) only indicates a
maximum display width of 4 characters. It does nothing for the stroed value
size. Tinyint will only ever be 1 byte in size, with a possible 256 values
(0-255). Use unsigned if all your values are going to be positive.

Somehow though, I think you would be better off with:
<column> smallint unsigned auto_increment,
for your column def. (0-65535) for a smaller database.



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to