Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PHP SYNTAX


OSC-Sevilla

Recommended Posts

Getting an error with just "code suffix" (MOD)- it should be working but i dont know why (product attrbutes.php):

 

The SQL IS FINE so

 

1054 - Unknown column 'GL' in 'field list'

 

INSERT INTO products_attributes ( products_id, options_id, options_values_id, code_suffix, suffix_sort_order, options_values_price, price_prefix, products_options_sort_order) VALUES (440, 4, 18, GL, 2, 20.0000, '+' , 3)

 

----------------------------

// BOE: Attribute Sort with Clone Tool

case 'clone_attributes':

$clone_product_id_from = $HTTP_POST_VARS['clone_products_id_from'];

$clone_product_id_to = $HTTP_POST_VARS['clone_products_id_to'];

tep_db_query("delete from ".TABLE_PRODUCTS_ATTRIBUTES." WHERE products_id='".$clone_product_id_to."'");

$attributes = tep_db_query("select products_id, options_id, options_values_id, code_suffix, suffix_sort_order, options_values_price, price_prefix, products_options_sort_order from " . TABLE_PRODUCTS_ATTRIBUTES ." where products_id='".$clone_product_id_from."'");

while($attributes_values = tep_db_fetch_array($attributes)) {

tep_db_query("INSERT INTO " . TABLE_PRODUCTS_ATTRIBUTES . " ( products_id, options_id, options_values_id, code_suffix, suffix_sort_order, options_values_price, price_prefix, products_options_sort_order) VALUES (".$clone_product_id_to.", ".$attributes_values['options_id'].", ".$attributes_values['options_values_id'].", ".$attributes_values['code_suffix'].", ".$attributes_values['suffix_sort_order'].", ".$attributes_values['options_values_price'].", '".$attributes_values['price_prefix']."' , ".$attributes_values['products_options_sort_order'].")");

}

tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info));

break;

// EOE: Attribute Sort with Clone Tool

 

 

--------------------------------

 

what does "1054 - Unknown column 'GL' in 'field list'" mean????

 

 

Thanks

Link to comment
Share on other sites

It looks like it's trying to put in a string, value GL, but there are no quotes around it. Change

...id'].", ".$attributes_values['code_suffix'].", ".$a...

to

...id'].", '".$attributes_values['code_suffix']."', ".$a...

(two ' added).

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...