Code:
$db->Execute("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " (products_attributes_id, products_id, options_id, options_values_id, options_values_price, price_prefix, products_options_sort_order, product_attribute_is_free, products_attributes_weight, products_attributes_weight_prefix, attributes_display_only, attributes_default, attributes_discounted, attributes_image, attributes_price_base_included, attributes_price_onetime, attributes_price_factor, attributes_price_factor_offset, attributes_price_factor_onetime, attributes_price_factor_onetime_offset, attributes_qty_prices, attributes_qty_prices_onetime, attributes_price_words, attributes_price_words_free, attributes_price_letters, attributes_price_letters_free, attributes_required)
values (0,
'" . (int)$products_id . "',
'" . (int)$options_id . "',
'" . (int)$values_id . "',
'" . (float)zen_db_input($value_price) . "',
'" . zen_db_input($price_prefix) . "',
'" . (int)zen_db_input($products_options_sort_order) . "',
'" . (int)zen_db_input($product_attribute_is_free) . "',
'" . (float)zen_db_input($products_attributes_weight) . "',
'" . zen_db_input($products_attributes_weight_prefix) . "',
'" . (int)zen_db_input($attributes_display_only) . "',
'" . (int)zen_db_input($attributes_default) . "',
'" . (int)zen_db_input($attributes_discounted) . "',
'" . zen_db_input($attributes_image_name) . "',
'" . (int)zen_db_input($attributes_price_base_included) . "',
'" . (float)zen_db_input($attributes_price_onetime) . "',
'" . (float)zen_db_input($attributes_price_factor) . "',
'" . (float)zen_db_input($attributes_price_factor_offset) . "',
'" . (float)zen_db_input($attributes_price_factor_onetime) . "',
'" . (float)zen_db_input($attributes_price_factor_onetime_offset) . "',
'" . zen_db_input($attributes_qty_prices) . "',
'" . zen_db_input($attributes_qty_prices_onetime) . "',
'" . (float)zen_db_input($attributes_price_words) . "',
'" . (int)zen_db_input($attributes_price_words_free) . "',
'" . (float)zen_db_input($attributes_price_letters) . "',
'" . (int)zen_db_input(
As previously pointed out the auto-increment ought to assign a new value other than 0 to the attribute_id, but there are some servers that are not setup to do that with a value of zero presented... Two solutions I see, either find all such assignments in all queries and either attempt to use null instead or remove such an assignment or work with your host to have them adjust or help you to adjust the mysql settings so that auto_numbering can't start on 0 but instead 1.
Bookmarks