470,561 Members | 1,915 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,561 developers. It's quick & easy.

tinyint field column value constantly resets to "127", why?

For some bizarre reason, each time I insert or update a row in my table
`image`, the field value for "image_width" is fixed at 127, no matter
what value I use!

Here is the schema:

CREATE TABLE /*! IF NOT EXISTS */ image (
id int not null auto_increment,
primary key (id),
image_path varchar(255) not null,
image_url varchar(255) not null,
image_width tinyint not null,
image_height tinyint not null,
image_alt_text varchar(255),
record_entered datetime,
unique_key varchar(20) not null
) /*! TYPE=MyISAM */;

I've tried PHPMyAdmin all the way to command-line MySQL, to no avail;
the image_width value constantly resets itself to "127", all other
vlues are fine.

Why would this happen?

Phil

Jun 1 '06 #1
2 3889
ph**************@gmail.com wrote:
For some bizarre reason, each time I insert or update a row in my table
`image`, the field value for "image_width" is fixed at 127, no matter
what value I use!


Tinyint is a 1-byte signed datatype; it has a range of -128 to 127.

http://dev.mysql.com/doc/refman/5.0/...ric-types.html

Regards,
Bill K.
Jun 2 '06 #2
Yeah sorry but 1 byte doesn't translate for me, I've never understood
bit-vs-byte no matter how much it's explained to me.

I changed "tinyint" to "smallint" and it's fine now, thanx

Phil

Bill Karwin wrote:
ph**************@gmail.com wrote:
For some bizarre reason, each time I insert or update a row in my table
`image`, the field value for "image_width" is fixed at 127, no matter
what value I use!


Tinyint is a 1-byte signed datatype; it has a range of -128 to 127.

http://dev.mysql.com/doc/refman/5.0/...ric-types.html

Regards,
Bill K.


Jun 2 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Manuel Faux | last post: by
86 posts views Thread by Randy Yates | last post: by
4 posts views Thread by John Devereux | last post: by
6 posts views Thread by Kai BÝhli | last post: by
25 posts views Thread by mdh | last post: by
48 posts views Thread by Frederick Gotham | last post: by
5 posts views Thread by Jess | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.