Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Database error when adding attributes


zeus_r6

Recommended Posts

Any idea what is causing this while attempting to add an attribute? and a possible workaround?

 

1136 - Column count doesn't match value count at row 1

 

insert into products_attributes values (null, '129', '10', '48', '0', '+')

 

[TEP STOP]

 

Thanks in advance!

Link to comment
Share on other sites

I can see looking in phpmyadmin that it's inserting a null value into the database when trying to create the new attribute. Ideas what is causing it to do that?

Link to comment
Share on other sites

The "null" would be for an autoincremented field -- you don't want to give it a value, but to let it figure it out on its own. The error message was because you had a different number of fields defined in the table than the number of values you gave. This is an example of very poor coding practice -- you should always give a list of fields so that it's easy to see that values and fields match up (and you can let unlisted fields, such as an autoincremented ID field, take their default values).

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...