p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

beginning_php thread: mySql


Message #1 by "Wayne Frisch" <wfrisch@b...> on Wed, 24 Apr 2002 03:23:50
I have a table in my db which after 127 items will not allow any new 
items to be added..??


Sorry if this is a stupid question but I have never ran into this


Wayne
Message #2 by "Nikolai Devereaux" <yomama@u...> on Wed, 24 Apr 2002 09:51:05 -0700
Could you be a bit more specific?  Are you adding 127 ROWS into a table, or
creating a table with more than 127 COLUMNS?

If you're creating a table with more than 127 columns, then you seriously
need to redesign your database schema.  I wouldn't be surprised if there was
an imposed limit on the number of possible fields in a table.

nik

Message #3 by "Wayne Frisch" <wfrisch@b...> on Thu, 25 Apr 2002 03:11:45
I have only about 20 columns.

I found somthing on mysql site relating to 127 and indexed fields.

I changed the id field from a TINYINT to INT and it fixed the limitation
why I still do not know?


> 
Could you be a bit more specific?  Are you adding 127 ROWS into a table, or
creating a table with more than 127 COLUMNS?

If you're creating a table with more than 127 columns, then you seriously
need to redesign your database schema.  I wouldn't be surprised if there 
was
an imposed limit on the number of possible fields in a table.

nik

Message #4 by "Nikolai Devereaux" <yomama@u...> on Wed, 24 Apr 2002 22:15:39 -0700
> I have only about 20 columns.
>
> I found somthing on mysql site relating to 127 and indexed fields.
>
> I changed the id field from a TINYINT to INT and it fixed the limitation
> why I still do not know?

TINY_INT and INT are different sizes in memory.  TINY_INT is probably just a
byte, which is 8 bits, so the range of integer values this can hold are -128
to 127.

You probably didn't specify that the TINY_INT field was unsigned.  If you
did, you should be able to store up to 256 rows.

If you don't understand this very brief explanation, then you should learn
about binary numbers and basic data types.  It's not imperative to know this
stuff for simple PHP programming, but it's part of a fundamental knowledge
that I believe all programmers should know.


Take care,

Nik


  Return to Index