Jump to content

Fatal error: Uncaught You have an error in your SQL syntax


HAIRWEBSHOP

Recommended Posts

Fatal error: Uncaught You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'hw_hook_module` hm ON hm.`id_module` = m.`id_module` INNER JOIN `hw_hook` h ON h' at line 5<br /><br /><pre>SELECT h.`name` as hook, m.`id_module`, h.`id_hook`, m.`name` as module, h.`live_edit` FROM `hw_module` m INNER JOIN hw_module_shop module_shop ON (module_shop.id_module = m.id_module AND module_shop.id_shop = 1 AND module_shop.enable_device & 1) INNER JOIN `hw_module_shop` ms ON ms.`id_module` = m.`id_module INNER JOIN `hw_hook_module` hm ON hm.`id_module` = m.`id_module` INNER JOIN `hw_hook` h ON hm.`id_hook` = h.`id_hook` LEFT JOIN `hw_module_group` `mg` ON mg.`id_module` = m.`id_module` WHERE (h.name != "displayPayment") AND (hm.id_shop = 1) AND (mg.id_shop = 1 AND mg.`id_group` IN (3)) GROUP BY hm.id_hook, hm.id_module ORDER BY hm.`position` </pre> thrown in /path/to/prestashop/www/classes/db/Db.php on line 791

For some reason, this happend after uploading an image.

Backend seems to work fine, ass well as product pages. But a huge chunk of the theme is missing.

 

What's going on and how do I fix this?

Link to comment
Share on other sites

Hello tuk66 and ndiaga, and thank you kindly for your reply!

 

I did not install any module, nor have I made any changes in configuration.

I was just adding new products, and suddenly uploading an imaged failed and shortly after, this error popped up.
This was due to PS_MODE_DEV set to true, setting it to false resulted in an empty front office page with only the logo. The dashboard, however, was fully functional.

 

I tried repairing database tables, and now it works again.

Edited by HAIRWEBSHOP (see edit history)
Link to comment
Share on other sites

  • 3 years later...
On 5/23/2016 at 2:55 PM, HAIRWEBSHOP said:

Hello tuk66 and ndiaga, and thank you kindly for your reply!

 

I did not install any module, nor have I made any changes in configuration.

I was just adding new products, and suddenly uploading an imaged failed and shortly after, this error popped up.
This was due to PS_MODE_DEV set to true, setting it to false resulted in an empty front office page with only the logo. The dashboard, however, was fully functional.

 

I tried repairing database tables, and now it works again.

Hi.

Could you tell me how to repare tables? It is not possible from phpmyadmin:

 

The storage engine for the table doesn't support r...

Error:

 

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 ') INNER JOIN pr_category_product cp ON (p.id_product = cp.id_product) INNER JOIN' at line 1

 

SELECT psi.price_min, MIN(price_min) as min, MAX(price_max) as max FROM pr_product p INNER JOIN pr_layered_price_index psi ON (psi.id_product = p.id_product AND psi.id_shop = 1 AND psi.id_currency = 1 AND psi.id_country = ) INNER JOIN pr_category_product cp ON (p.id_product = cp.id_product) INNER JOIN pr_product_shop ps ON (p.id_product = ps.id_product AND ps.id_shop = 1 AND ps.active = TRUE) WHERE p.id_category_default='1101138' AND cp.id_category='1101138' AND p.visibility IN ('both', 'catalog') AND ps.id_shop='1'

 

Link to comment
Share on other sites

Hi again,

just for people who come here with this error. 

I solve it.

 

If you look here:

SELECT psi.price_min, MIN(price_min) as min, MAX(price_max) as max FROM pr_product p INNER JOIN pr_layered_price_index psi ON (psi.id_product = p.id_product AND psi.id_shop = 1 AND psi.id_currency = 1 AND psi.id_country = ) INNER JOIN pr_category_product cp ON (p.id_product = cp.id_product) INNER JOIN pr_product_shop ps ON (p.id_product = ps.id_product AND ps.id_shop = 1 AND ps.active = TRUE) WHERE p.id_category_default='1101138' AND cp.id_category='1101138' AND p.visibility IN ('both', 'catalog') AND ps.id_shop='1'

 

this:

(psi.id_product = p.id_product AND psi.id_shop = 1 AND psi.id_currency = 1 AND psi.id_country = ) 

 

you will notice, that 

psi.id_country =

is EMPTY.

I went to backoffice, and a set country with mine (Spain). It was by default Afganistan.

I really think, that Afganistan it is not settle correctly by prestashop developers, because maybe, none frmo there manage this kind of CMS.

So, I change to Spain, and now, no error after navigation through categories.

 

Link to comment
Share on other sites

  • 7 months later...

Iam getting following error. How to fix this ? 

(3/3) SyntaxErrorException

An exception occured in driver: SQLSTATE[42000] [1064] You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '@@sql_mode,'ONLY_FULL_GROUP_BY',''))' at line 1

in AbstractMySQLDriver.php line 90

at AbstractMySQLDriver->convertException('An exception occured in driver: SQLSTATE[42000] [1064] You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near \'@@sql_mode,\'ONLY_FULL_GROUP_BY\',\'\'))\' at line 1', object(PDOException))in DBALException.php line 145

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...