Connecting Tech Pros Worldwide Forums | Help | Site Map

Maximum # of columns creating a table

Newbie
 
Join Date: Sep 2009
Posts: 18
#1: Oct 12 '09
I am having a heck of a time creating a table with more than 140 or so columns when using php into mysql. Any known issues after a certain #?

Thanks,

Markus's Avatar
Moderator
 
Join Date: Jun 2007
Location: York, England, with wolves.
Posts: 4,948
#2: Oct 12 '09

re: Maximum # of columns creating a table


Can you elaborate? Do you receive any errors. See this article.

Mark.
Newbie
 
Join Date: Sep 2009
Posts: 18
#3: Oct 13 '09

re: Maximum # of columns creating a table


From MYSQL I receive the following error message:

error while executing query

mysql error number 1005
cant create table 'inventory.#sql4c_2b066a'(errno: 139)


I can add a certain number of entries (1000 total, 125 identical lines as follows with different names):

IPF VARCHAR(20) NOT NULL, IPFDESCRIPTION VARCHAR(90) NOT NULL, IPFSIZE VARCHAR(20) NOT NULL, IPFNOTES VARCHAR(20) NOT NULL, IPFDISTRIBUTION VARCHAR(20) NOT NULL, IPFCURRENT VARCHAR(5) NOT NULL, IPFLIMIT VARCHAR(5) NOT NULL, IPFCOST VARCHAR(10) NOT NULL

When I attempt to add one more, the table is not created and I get the above mentioned error.
Newbie
 
Join Date: Sep 2009
Posts: 18
#4: Oct 13 '09

re: Maximum # of columns creating a table


So, InnoDB allows no more than 1000 columns. This is my problem, Can I choose something else? If so, how do I do it when creating the table from a php script?
Newbie
 
Join Date: Sep 2009
Posts: 18
#5: Oct 13 '09

re: Maximum # of columns creating a table


Disregard, MYISAM is the trick

Thank you for your help.....
Reply