OSC-Sevilla Posted September 9, 2011 Posted September 9, 2011 SEE IMAGES ATTACHED I think its an SQL ERROR... PLs COmment. I get the follwing error on "INSERT" 1136 - Column count doesn't match value count at row 1 insert into products_attributes values (null, '307', '2', '23', '0', '+') [TEP STOP]
MrPhil Posted September 11, 2011 Posted September 11, 2011 insert into products_attributes values (null, '307', '2', '23', '0', '+') That's why it's so much better coding practice to explicitly list the fields being updated (before the VALUES clause) -- it eliminates the chances of this mismatch happening. Was this core product code, an add-on, or your own code?
OSC-Sevilla Posted September 11, 2011 Author Posted September 11, 2011 This was an addon "Sort attributes" - it added a line to my sql that messed it up - removed it (back to stock) and all GREAT! Does anyone know a mod that will allow you to add your atrributes on the product entry page? that would save me lots of back and fourth, dito for documents manager ---- just a ? I wish i had time to code out the "Products specifications CONTRIB - " Thanks
Coop3167 Posted November 3, 2011 Posted November 3, 2011 I'm getting the same problem 1136 - Column count doesn't match value count at row 1 insert into products_attributes values (null, '54', '2', '2', '0', '+', '0') [TEP STOP] Can you tell me what your solution was/is?
MrPhil Posted November 4, 2011 Posted November 4, 2011 As of osC 2.3.1, there are still only 6 fields defined for that table, and you have seven values. Did you add an add-on/mod that adds another field to that table, and neglect to run some code to update the database (actually add the field to the table)?
Coop3167 Posted November 4, 2011 Posted November 4, 2011 As of osC 2.3.1, there are still only 6 fields defined for that table, and you have seven values. Did you add an add-on/mod that adds another field to that table, and neglect to run some code to update the database (actually add the field to the table)? I followed the steps from Easy Populate 2.77a setup and Product Attributes Sort Order v1.83a ... Everything seem to be working well... I added This is the structure attribute_sort but I think I can remove it ??? Field Type Collation Attributes Null Default attribute_sort int(10) UNSIGNED No 0 products_attributes_id int(11) No auto_increment products_id options_id int(11) No options_values_id int(11) No options_values_price "decimal(15,4)" No price_prefix char(1) latin1_swedish_ci No products_options_sort_order int(10) UNSIGNED No 0
Coop3167 Posted November 4, 2011 Posted November 4, 2011 Could not copy paste the Structure not so good
MrPhil Posted November 4, 2011 Posted November 4, 2011 Try putting the new field in last, after the original 6 fields (probably have to add a comma after the 6th field). Yet again, reason to explicitly list all the field names in the INSERT statement!
Coop3167 Posted November 7, 2011 Posted November 7, 2011 Try putting the new field in last, after the original 6 fields (probably have to add a comma after the 6th field). Yet again, reason to explicitly list all the field names in the INSERT statement! Will try thanks
Recommended Posts
Archived
This topic is now archived and is closed to further replies.