Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2003
    Posts
    225

    Unanswered: 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

  2. #2
    Join Date
    Apr 2006
    Location
    Denver, Co. USA
    Posts
    242
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •