If we analyse the INPUTS, we get:
products_quantity, '0',
products_type, '3',
products_model, '',
products_price, '0',
products_date_available, null,
products_weight, '0',
products_status, '1',
products_virtual, '0',
products_tax_class_id, '0',
manufacturers_id, '0',
products_quantity_order_min, '1',
products_quantity_order_units, '1',
products_priced_by_attribute, '',
product_is_free, '0',
product_is_call, '0',
products_quantity_mixed, '',
product_is_always_free_shipping, '0',
products_qty_box_status, '',
products_quantity_order_max, '',
products_sort_order, '0',
products_discount_type, '0',
products_discount_type_from, '0',
products_price_sorter, '0',
products_image, '',
products_date_added, now(),
master_categories_id, '216'
products_priced_by_attribute, '', Is the first instance of this falling over, because an integer is expected, but no value is given.
It is likely that when this is fixed, the NEXT instance of an expected integer value which is empty is:
products_quantity_mixed, '', (INTEGER IS EXPECTED)
... and then:
products_qty_box_status, '', (INTEGER IS EXPECTED)
...whereas:
products_image, '', (This field is VARCHAR, so being empty does not matter).
So... MAYBE if you add the three expected integers via Dr Byte's suggested fix...
Code:// Data-cleaning to prevent MySQL5 data-type mismatch errors: $tmp_value = zen_db_prepare_input($_POST['products_quantity']); $products_quantity = (!zen_not_null($tmp_value) || $tmp_value=='' || $tmp_value == 0) ? 0 : $tmp_value; $tmp_value = zen_db_prepare_input($_POST['products_price']); $products_price = (!zen_not_null($tmp_value) || $tmp_value=='' || $tmp_value == 0) ? 0 : $tmp_value; $tmp_value = zen_db_prepare_input($_POST['products_weight']); $products_weight = (!zen_not_null($tmp_value) || $tmp_value=='' || $tmp_value == 0) ? 0 : $tmp_value; $tmp_value = zen_db_prepare_input($_POST['manufacturers_id']); $manufacturers_id = (!zen_not_null($tmp_value) || $tmp_value=='' || $tmp_value == 0) ? 0 : $tmp_value; $tmp_value = zen_db_prepare_input($_POST['products_priced_by_attribute']); $products_priced_by_attribute = (!zen_not_null($tmp_value) || $tmp_value=='' || $tmp_value == 0) ? 0 : $tmp_value; $tmp_value = zen_db_prepare_input($_POST['products_quantity_mixed']); $products_quantity_mixed = (!zen_not_null($tmp_value) || $tmp_value=='' || $tmp_value == 0) ? 0 : $tmp_value; $tmp_value = zen_db_prepare_input($_POST['products_qty_box_status']); $products_qty_box_status = (!zen_not_null($tmp_value) || $tmp_value=='' || $tmp_value == 0) ? 0 : $tmp_value; $sql_data_array = array('products_quantity' => $products_quantity, 'products_type' => zen_db_prepare_input($_GET['product_type']), 'products_model' => zen_db_prepare_input($_POST['products_model']), 'products_price' => $products_price, 'products_date_available' => $products_date_available, 'products_weight' => $products_weight, 'products_status' => zen_db_prepare_input((int)$_POST['products_status']), 'products_virtual' => zen_db_prepare_input((int)$_POST['products_virtual']), 'products_tax_class_id' => zen_db_prepare_input((int)$_POST['products_tax_class_id']), 'manufacturers_id' => $manufacturers_id, 'products_quantity_order_min' => zen_db_prepare_input($_POST['products_quantity_order_min']), 'products_quantity_order_units' => zen_db_prepare_input($_POST['products_quantity_order_units']), 'products_priced_by_attribute' => zen_db_prepare_input($_POST['products_priced_by_attribute']), 'product_is_free' => zen_db_prepare_input((int)$_POST['product_is_free']), 'product_is_call' => zen_db_prepare_input((int)$_POST['product_is_call']), 'products_quantity_mixed' => zen_db_prepare_input($_POST['products_quantity_mixed']), 'product_is_always_free_shipping' => zen_db_prepare_input((int)$_POST['product_is_always_free_shipping']), 'products_qty_box_status' => zen_db_prepare_input($_POST['products_qty_box_status']), 'products_quantity_order_max' => zen_db_prepare_input($_POST['products_quantity_order_max']), 'products_sort_order' => (int)zen_db_prepare_input($_POST['products_sort_order']), 'products_discount_type' => zen_db_prepare_input($_POST['products_discount_type']), 'products_discount_type_from' => zen_db_prepare_input($_POST['products_discount_type_from']), 'products_price_sorter' => zen_db_prepare_input($_POST['products_price_sorter']) );


Reply With Quote
