View Full Version : Help me decode this...
m0nk3y
10-26-2007, 12:25 PM
1136 - Column count doesn't match value count at row 1
insert into products_attributes values ('', '47', '2', '6', '20', '+')
[TEP STOP]
I'm a php-noob, so don't kill me. This is in OScommerce when updating a product. There is no like 1136 in categories.php (ref), only up to 1117
Zealot
10-26-2007, 12:31 PM
Do you have 6 columns in the table? If not you need to specify which columns you are inserting the info into.
insert into products_attributes(column1,column2,etc.) values ('', '47', '2', '6', '20', '+')
Also be sure the other columns not listed can accept null values
m0nk3y
10-26-2007, 12:36 PM
not found in categories.php.
hmm.
Zealot
10-26-2007, 12:40 PM
What's not found?
m0nk3y
10-26-2007, 12:40 PM
OK, I get the second part.
in: insert into products_attributes values ('', '47', '2', '6', '20', '+')
The numbers refer to product_option ID numbers to ref the variable for the pull down menu. beyond that, still stumped. the + doesn't make sense, as + isn't an ID.
Zealot
10-26-2007, 12:44 PM
What is it's corresponding column header in the table, that may help shine some light on it's purpose
m0nk3y
10-26-2007, 12:49 PM
ok, it's trying to add + $20 to attribute ID 6 for this product
Zealot
10-26-2007, 12:52 PM
That seems an odd way to do it, you would think they would do the calculation before the insert
m0nk3y
10-26-2007, 01:01 PM
I've been on the support site, no replies from anyone... but no one else seems to have had this problem, and it's a fairly widely used mod.
MianoSM
10-26-2007, 02:36 PM
You lost me at 1136.
What IDE are you using?
Nikon
10-26-2007, 07:58 PM
post the results of the following query...
DESCRIBE TABLE products_attributes;
I thought something looked fishy about that stray ". Maybe the software isn't handling that properly.
Nikon
10-26-2007, 09:09 PM
I thought something looked fishy about that stray ". Maybe the software isn't handling that properly.
Nick:
Using a table similar to this...
Users
----------------
Unique ... int(10), autoincrement, primary key
Username ... varchar(32)
Password ... varchar(64)
Email ... varchar(64)
When doing INSERT statements, you either have to define a value for each column in the table as such...
INSERT INTO Users VALUES (1, 'Nikon', 'WouldntYouLikeToKnow', 'foo@bar.com');
... or because the value will be handled later on (or not at all, like autoincrement on 'Unique', then you need to specify which columns you want data to go into and put the values in the same order...
INSERT INTO Users (Username, Password, Email) VALUES ('Nikon', 'WouldntYouLikeToKnow', 'foo@bar.com');
The error you are receiving is because you either have too many or not enough columns in the insert statement. If a column is set with an attribute of 'NOT NULL' must be provided a value or I think MySQL will simply use '0' as a value.
m0nk3y
10-26-2007, 09:22 PM
there were too many. I forgot to post here, but we got it figured out, just working on the last few details of merging three modified config files
Nikon, you're all smart and stuffs! :love:
I suck with SQL.
he had 2 "hacks" to install and both of them required changes to the same file. Neither hack instructions took into account other mods. One of the hacks did a change on the table to add another field, but the inserts from the other hack didnt take that into account so he had to merge the changes to the files from original, hack1 and hack2.
dont realise just how nice the vBulletin system for plugins/hooks is until you see how others do it.. lol
m0nk3y
10-27-2007, 02:41 PM
We're still not 100% there because the hacks are still conflicting, but way closer to a solution. Thankfully, there were some good ideas in here, Zate helped me and also I have a buddy from a ford forum helping me put it all together... Thanks, all!
vBulletin® v3.6.10, Copyright ©2000-2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by
vBSEO 3.0.0 RC8