Skip to main content

1064 You have an error in your SQL syntax;

More
10 years 9 months ago #224142 by hdouglas
-- HikaShop version -- : 2.6.0
-- Joomla version -- : 3.4.6
-- PHP version -- : 5.4.45
-- Browser(s) name and version -- : Firefox 42.0
-- Error-message(debug-mod must be tuned on) -- : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ORDER BY warehouse_name' at line 1 SQL=SELECT warehouse_id, warehouse_name FROM td4i8_hikashop_warehouse WHERE warehouse_id IN () ORDER BY warehouse_name

When trying to open a product in the backend the following error is reported.

1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ORDER BY warehouse_name' at line 1 SQL=SELECT warehouse_id, warehouse_name FROM td4i8_hikashop_warehouse WHERE warehouse_id IN () ORDER BY warehouse_name

Debug is NOT showing the full SQL query, just the stack which tends to indicate a PHP error although there is no PHP error being reported in the error log.

Please Log in or Create an account to join the conversation.

More
10 years 9 months ago #224144 by nicolas
Hi,

Change the code:
Code:
$values = array_merge($values); JArrayHelper::toInteger($values); $query = 'SELECT warehouse_id, warehouse_name '. ' FROM ' . hikashop_table('warehouse') . ' WHERE warehouse_id IN ('.implode(',', $values).') '. ' ORDER BY warehouse_name';
to:
Code:
JArrayHelper::toInteger($value); $query = 'SELECT warehouse_id, warehouse_name '. ' FROM ' . hikashop_table('warehouse') . ' WHERE warehouse_id IN ('.implode(',', $value).') '. ' ORDER BY warehouse_name';
in the file administrator/components/com_hikashop/classes/warehouse.php and that should fix the problem.

Please Log in or Create an account to join the conversation.

Time to create page: 0.170 seconds
Powered by Kunena Forum