Re: Size restrictions in MySQL table?

From: Date: Thu, 01 Jan 1970 00:00:00 +0000
Subject: Re: Size restrictions in MySQL table?
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-5131@lists.php.net to get a copy of this message
Your problems stems from the fact that you used a tinyint(7) as your data type for your id column. A tinyint(7) can only store up to 127, and higher values will cause a unique key conflict. If you alter the table to use a larger datatype for the id column, then everything should work. Thanks. Peter On Sat, 9 Dec 2000, Knut Lekvam wrote: > I've made some registration scripts on my pages which stores the page the visitor is on, > the date and his IP; > > IDnumber for the registered page visited (nrid) > page visited (side) > Time of the visit (datetime) > IP number of the visitor (ipno) > > The following table was made in mysql: > > CREATE TABLE besok > (nrid TINYINT(7) DEFAULT '0' NOT NULL AUTO_INCREMENT PRIMARY KEY, > side VARCHAR (40) NOT NULL, > datetime DATETIME NOT NULL, > ipno VARCHAR(255) NOT NULL ); > > I tried this on the server and on my own computer. It seems like the logging stops when there > are stored 128 visits in the table. It works very fine up to this point. How do I increase the > storage capasity in mysql. ?? > > Also when I try to insert new records in the table manualy with the command: > > INSERT INTO besok (nrid,side,datetime,ipno) > VALUES (128,'test.php3',20001205133245,'62.66.242.204'); > > , I get this response: > > Duplicate entry '127' for key 1 > > I understand that this relates to the last stored value of nrid which had a value of 127. But I > tried to stor either autoincrement (128) which is the next value or 128 manualy as described above. > > Does anyone understand this ? > > > Is this related to my PHP code instead? > > Or is it the server that is not working? I have this on free.fr which is a free french server > supporting 100MB free server place and supports PHP and mysql. I am just testing and I am thus > nowhere close to the limit. I tried this both on on the server and on my own computer. I can delete > a few of the last rows manually on both and then they both work OK until I have 127 rows stored in > the table, and it stops storing new data again. > > -- > Knut Lekvam > Kannikgt. 21/ A9 > 4008 Stavanger > 51539241 / 97518748 > knut@snill.no > www.snill.no > > __________________________________________________________________ > > Denne eposten er sendt ved hjelp av http://www.Organizer.net > - Norges ledende webbaserte kommunikasjonsløsning. > > >

« previous php.db (#5131) next »