1064 You have an error in your SQL syntax;

  • Posts: 4
  • Thank you received: 0
9 years 5 months ago #224142

-- 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.

  • Posts: 83799
  • Thank you received: 13571
  • MODERATOR
9 years 5 months ago #224144

Hi,

Change the 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:
				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.045 seconds
Powered by Kunena Forum