Guest Posted December 20, 2002 Posted December 20, 2002 1136 - Column count doesn't match value count at row 1 insert into products_attributes values ('', '1051', '1', '10', '0', '') Help, my attributes arent being inserted into the database. Just installed the alternate attribute handling with big images merge. What am I doing wrong here??? Thanks in Advance! Please ignore my partners test images :) http://www.partytimeproducts.com/catalog/default.php
Ajeh Posted December 21, 2002 Posted December 21, 2002 Do you have more or less fields than defined there? That insert contains 6 fields. How many do you have in your products_attributes table?
Guest Posted December 21, 2002 Posted December 21, 2002 Hey Linda Thanks for responding. Looks likeI have ten fields somehow. Not sure what to do next here. Any ideas? Thanks soooo much! :? products_attributes_id int(11) products_id int(11) options_id int(11) options_values_id int(11) options_values_price decimal(15,4) price_prefix varchar(5) options_type_id smallint(6) options_values_qty int(11) attribute_order smallint(6) collegamento int(11)
Ajeh Posted December 21, 2002 Posted December 21, 2002 You need to edit the insert statement then to include values for all of your fields.
Guest Posted December 21, 2002 Posted December 21, 2002 I just ran the query on the attr table again. DROP TABLE IF EXISTS products_attributes; CREATE TABLE products_attributes ( products_attributes_id int NOT NULL auto_increment, products_id int NOT NULL, options_id int NOT NULL, options_values_id int NOT NULL, options_values_price decimal(15,4) NOT NULL, price_prefix char(1) NOT NULL, PRIMARY KEY (products_attributes_id) ); Think I have it. works great now :) Thanks, for the hint :) Cya. L8R
Parikesit Posted March 5, 2003 Posted March 5, 2003 I think it can fixed by this short way: tep_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " values ('', '" . $products_id . "', '" . $options['products_options_id'] . "', '" . $values['products_options_values_id'] . "', '" . $HTTP_POST_VARS['price'][$rows] . "', '" . $HTTP_POST_VARS['prefix'][$rows] . "')"); tep_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES . "(products_attributes_id, products_id, options_id, options_values_id, options_values_price, price_prefix) values ('', '" . $products_id . "', '" . $options['products_options_id'] . "', '" . $values['products_options_values_id'] . "', '" . $HTTP_POST_VARS['price'][$rows] . "', '" . $HTTP_POST_VARS['prefix'][$rows] . "')"); zaenal recent contributions: mySQLi extension for osc 2.X, OPI: advanced image handling (ajax, thumbnail, watermark, etc), and other contributions all here
Ajeh Posted March 6, 2003 Posted March 6, 2003 Actually not a good plan ... :shock: The products_attributes_id is an autoincrement field which is why the insert has that value as '' and does not have it defined ... this lets it autoincrement ... :D
Recommended Posts
Archived
This topic is now archived and is closed to further replies.