- Posts: 7
- Thank you received: 0
1064 You have an error in your SQL syntax
10 years 9 months ago #225375
by MichelH
1064 You have an error in your SQL syntax was created by MichelH
-- HikaShop version -- : 2.6.0
-- Joomla version -- : 3.4.8
-- PHP version -- : 5.4.3
-- Error-message(debug-mod must be tuned on) -- : I receive the error message when i do mass action on root category:
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 ') OR product_parent_id IN ()) ORDER BY product_code DESC LIMIT 0, 500' at line 1 SQL=SELECT hk_product.* FROM Chau_hikashop_product as hk_product WHERE (product_id IN () OR product_parent_id IN ()) ORDER BY product_code DESC LIMIT 0, 500
I make the following change and same problem
$query = 'SELECT category_id FROM '.hikashop_table('category').' WHERE category_parent_id='.(int)$this->getRoot().' AND category_type='.(int)$this->database->Quote($element).' LIMIT 1';
$this->database->setQuery($query);
$element = (int)$this->database->loadResult();
I receive the error message when i do mass action on root category:
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 ') OR product_parent_id IN ()) ORDER BY product_code DESC LIMIT 0, 500' at line 1 SQL=SELECT hk_product.* FROM Chau_hikashop_product as hk_product WHERE (product_id IN () OR product_parent_id IN ()) ORDER BY product_code DESC LIMIT 0, 500
I make the following change and same problem
$query = 'SELECT category_id FROM '.hikashop_table('category').' WHERE category_parent_id='.(int)$this->getRoot().' AND category_type='.(int)$this->database->Quote($element).' LIMIT 1';
$this->database->setQuery($query);
$element = (int)$this->database->loadResult();
-- Joomla version -- : 3.4.8
-- PHP version -- : 5.4.3
-- Error-message(debug-mod must be tuned on) -- : I receive the error message when i do mass action on root category:
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 ') OR product_parent_id IN ()) ORDER BY product_code DESC LIMIT 0, 500' at line 1 SQL=SELECT hk_product.* FROM Chau_hikashop_product as hk_product WHERE (product_id IN () OR product_parent_id IN ()) ORDER BY product_code DESC LIMIT 0, 500
I make the following change and same problem
$query = 'SELECT category_id FROM '.hikashop_table('category').' WHERE category_parent_id='.(int)$this->getRoot().' AND category_type='.(int)$this->database->Quote($element).' LIMIT 1';
$this->database->setQuery($query);
$element = (int)$this->database->loadResult();
I receive the error message when i do mass action on root category:
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 ') OR product_parent_id IN ()) ORDER BY product_code DESC LIMIT 0, 500' at line 1 SQL=SELECT hk_product.* FROM Chau_hikashop_product as hk_product WHERE (product_id IN () OR product_parent_id IN ()) ORDER BY product_code DESC LIMIT 0, 500
I make the following change and same problem
$query = 'SELECT category_id FROM '.hikashop_table('category').' WHERE category_parent_id='.(int)$this->getRoot().' AND category_type='.(int)$this->database->Quote($element).' LIMIT 1';
$this->database->setQuery($query);
$element = (int)$this->database->loadResult();
Please Log in or Create an account to join the conversation.
10 years 9 months ago #225378
by nicolas
Replied by nicolas on topic 1064 You have an error in your SQL syntax
Hi,
Change the line:
to:
and change the line:
to:
in the file plugins/hikashop/massaction_product/massaction_product.php
and that should fix that problem.
Change the line:
Code:
$ids[] = $mainProduct->product_id;
Code:
$ids[] = (int)$mainProduct->product_id;
Code:
$query->where = array('product_id IN ('.implode(',',$ids).') OR product_parent_id IN ('.implode(',',$ids).')');
Code:
if(count($ids))
$query->where = array('product_id IN ('.implode(',',$ids).') OR product_parent_id IN ('.implode(',',$ids).')');
else
$query->where = array('product_id=0');
and that should fix that problem.
Please Log in or Create an account to join the conversation.
8 years 4 months ago #292611
by kaimor
Replied by kaimor on topic 1064 You have an error in your SQL syntax
I've got this message when trying to access Dashboard for HikaShop:
An error has occurred.
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 '*, COUNT(a.order_id) AS total FROM #__hikashop_order AS a LEFT JOIN #__hik' at line 1
What to do?
An error has occurred.
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 '*, COUNT(a.order_id) AS total FROM #__hikashop_order AS a LEFT JOIN #__hik' at line 1
What to do?
Please Log in or Create an account to join the conversation.
8 years 4 months ago #292622
by nicolas
Replied by nicolas on topic 1064 You have an error in your SQL syntax
Hi,
Do that modification in order to get the full MySQL query leading to that error:
www.hikashop.com/support/forum/2-general...ror-1054.html#287524
That will allow us to have a better picture of the situation.
Do that modification in order to get the full MySQL query leading to that error:
www.hikashop.com/support/forum/2-general...ror-1054.html#287524
That will allow us to have a better picture of the situation.
Please Log in or Create an account to join the conversation.
8 years 4 months ago - 8 years 4 months ago #292630
by kaimor
Replied by kaimor on topic 1064 You have an error in your SQL syntax
Hi,
New MySQL query leading to that error:
( www.hikashop.com/support/forum/2-general...ror-1054.html#287524 )
An error has occurred.
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 '*, COUNT(a.order_id) AS total FROM #__hikashop_order AS a LEFT JOIN #__hik' at line 1 SELECT DISTINCT(prod.order_product_id), *, COUNT(a.order_id) AS total FROM hklco_hikashop_order AS a LEFT JOIN hklco_hikashop_order_product AS prod ON prod.order_id = a.order_id LEFT JOIN hklco_hikashop_product AS p ON prod.product_id = p.product_id LEFT JOIN hklco_hikashop_product_category AS cat ON cat.product_id = p.product_id OR cat.product_id=p.product_parent_id LEFT JOIN hklco_hikashop_category AS categ ON cat.category_id = categ.category_id LEFT JOIN hklco_hikashop_address AS b ON a.order_billing_address_id=b.address_id LEFT JOIN hklco_hikashop_zone AS z ON b.address_country=z.zone_namekey WHERE a.order_type='sale' AND a.order_status IN ('confirmed') AND cat.category_id IN ('40','41','42','43','44','45') AND a.order_created > 1493622000 AND a.order_created < 1554069540 GROUP BY z.zone_namekey
New MySQL query leading to that error:
( www.hikashop.com/support/forum/2-general...ror-1054.html#287524 )
An error has occurred.
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 '*, COUNT(a.order_id) AS total FROM #__hikashop_order AS a LEFT JOIN #__hik' at line 1 SELECT DISTINCT(prod.order_product_id), *, COUNT(a.order_id) AS total FROM hklco_hikashop_order AS a LEFT JOIN hklco_hikashop_order_product AS prod ON prod.order_id = a.order_id LEFT JOIN hklco_hikashop_product AS p ON prod.product_id = p.product_id LEFT JOIN hklco_hikashop_product_category AS cat ON cat.product_id = p.product_id OR cat.product_id=p.product_parent_id LEFT JOIN hklco_hikashop_category AS categ ON cat.category_id = categ.category_id LEFT JOIN hklco_hikashop_address AS b ON a.order_billing_address_id=b.address_id LEFT JOIN hklco_hikashop_zone AS z ON b.address_country=z.zone_namekey WHERE a.order_type='sale' AND a.order_status IN ('confirmed') AND cat.category_id IN ('40','41','42','43','44','45') AND a.order_created > 1493622000 AND a.order_created < 1554069540 GROUP BY z.zone_namekey
Last edit: 8 years 4 months ago by kaimor.
Please Log in or Create an account to join the conversation.
8 years 4 months ago #292638
by nicolas
Replied by nicolas on topic 1064 You have an error in your SQL syntax
Hi,
It's apparently coming from a report which has been configured in a strange way. Disable them one by one via the menu Orders>Reports in order to find the one causing the issue. Then, delete it, or keep it unpublished and reconfigure it.
It's apparently coming from a report which has been configured in a strange way. Disable them one by one via the menu Orders>Reports in order to find the one causing the issue. Then, delete it, or keep it unpublished and reconfigure it.
Please Log in or Create an account to join the conversation.
8 years 4 months ago #292666
by kaimor
Replied by kaimor on topic 1064 You have an error in your SQL syntax
Thank you,
It was "Map" report.
Now all is all right!
It was "Map" report.
Now all is all right!
Please Log in or Create an account to join the conversation.
Time to create page: 0.204 seconds