If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > one of my fields always displays 127?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-18-06, 07:34
Chimp8471 Chimp8471 is offline
Registered User
 
Join Date: Mar 2003
Posts: 225
one of my fields always displays 127?

if you look at this:

http://www.chimp.cc/Players/

you will see that all the reg no's are 127,

I have changed these a number of times but they keep going back to 127..

i have no idea what is going on

current set up

Code:
CREATE TABLE `players` (
`PlayerID` int(11) NOT NULL auto_increment,
`Forename` varchar(50) default NULL,
`Surname` varchar(50) NOT NULL default '',
`DOB` date default NULL,
`RegNo` tinyint(4) default NULL,
`Photo` varchar(255) default NULL,
`Nickname` varchar(50) default NULL,
`Comments` varchar(255) default NULL,
`Position` varchar(50) default NULL,
`GamesPlayed` tinyint(4) default NULL,
`GoalsScored` tinyint(4) default NULL,
PRIMARY KEY (`PlayerID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;

please help
Reply With Quote
  #2 (permalink)  
Old 07-18-06, 10:40
dbmab dbmab is offline
Registered User
 
Join Date: Apr 2006
Location: Denver, Co. USA
Posts: 240
The maximum value for tinyint is 127. Something in your code is setting it to a value greater than what it can hold. The tinyint(4) syntax only specifies the maximum display width and has nothing to do with the maximum value. If RegNo needs to be greater than 127, the use a different data type.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On