View Full Version : Which of you PHP/OSC Gurus Can Answer This?

11-04-2003, 05:22 AM

I hired a coder to build this site http://www.colishcreations.com and it's having some problems - I'm hoping that one of you osc gurus can help me with this. Since then I've started building the osc sites on my own, but for now I still have this little problem site to fix and can't seem to figure the error out. I know the answer is probably staring me in the face, but I can't find it.

When my client tries to add attributes she gets this error:
1136 - Column count doesn't match value count at row 1
insert into products_attributes values ('', '43', '2', '3', '0', '+')

Any ideas on how to fix?
This is how I read the attribute values
' ' - not sure what this refers to - it seems that this referes to a blank space in one of the value fields, but I can't figure out why. I think that the product ID should be coming up there

43 - Product Name

2 - Option Name

3 - Option Value

0 - Value Price

+ - Prefix

So do you have any ideas on how to fix this?

The attributes to the products that were originally added to the store can be modified just fine. However when my client tries to add attributes to the newly added products she gets the error message. She did a fine job adding the products so its not a problem there.


11-04-2003, 05:34 AM
Did you add the attributes copier contribution?
We got a similar error after adding that because the order of the fields in the old table and the new table is different.

11-04-2003, 04:02 PM
Run this

insert into products_attributes values ('43', '2', '3', '0', '+');

does it work?

if so remove all the extra '', in the beginning of (s

11-04-2003, 11:38 PM
The reason for the first '' is because the first field is an autoincrement field, mysql will automatically generate the first value.

The problem is that after adding any contributions that affected the products_attributes table, the structure is different and the query is no longer valid.

If you added anything that changed this table you will need to go into the code and change the line,
insert into products_attributes values ('', '43', '2', '3', '0', '+')
so that the number of items in the brackets lines up with the columns in the table.

If you didn't add anything, then I apologise, I don't know why it is causing this error.

11-06-2003, 10:31 AM
how about....
assuming the table stucture is
id, field1, field2, field3, field4, field5

insert into products_attributes (field1,field2,field3,field4, field5) values ('1','2','3','4','+')

(to skip the autoincrement ID)