473,396 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 4028
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Manuel Faux | last post by:
Hello! I used the "File Upload - Validator" and the result is like the following: Line 13, column 204: there is no attribute "border" ....irefox!" title="Get Firefox!" border="0" /></a></p>...
86
by: Randy Yates | last post by:
In Harbison and Steele's text (fourth edition, p.111) it is stated, The C language does not specify the range of integers that the integral types will represent, except ot say that type int may...
4
by: John Devereux | last post by:
Hi, I would like some advice on whether I should be using plain "chars" for strings. I have instead been using "unsigned char" in my code (for embedded systems). In general the strings contain...
6
by: Kai Bøhli | last post by:
Hi all ! I've got a lot of feedback from (the always helpful) Jon Skeet on this subject before. Dispite this I'm still not there - due to my own lack of knowledge of course. Anyway, I'm...
2
by: P. Adhia | last post by:
Hello All, I am trying to redirect-restore a backup of a DB2 V6.x system (AIX 4.x) on DB2 V8.2 system (AIX 5.2). I get the above error with no other details. db2diag.log has a series of error...
25
by: mdh | last post by:
I wrote a little insignificant program, to help me write a more significant one!!...that was supposed to print all Ascii values from 0 to 127: >>>> #include <stdio.h> # define UPPER_LIMT 127...
48
by: Frederick Gotham | last post by:
The "toupper" function takes an int as an argument. That's not too irrational given that a character literal is of type "int" in C. (Although why it isn't of type "char" escapes me... ) The...
5
by: Jess | last post by:
Hello, I read the specification of width(n) and it says this function allows me to pad on the left to the stream's width, and this width is "streamsize". What is streamsize exactly? Is it...
3
by: blackrunner | last post by:
ERROR in my Query?! ERROR: Element GESCHLECHT is undefined in FORM. i think everything ok. Maby somebody can help me here Element GESCHLECHT is undefined in FORM. The error occurred...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.