By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,282 Members | 1,518 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,282 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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.