Jump to content

You have an error in your SQL syntax;


Recommended Posts

Ciao

ho un problema, quando un utente clicca su una categoria qualsiasi mi esce questo errore :

come posso risolverlo??

grazie

 

[PrestaShopDatabaseException]

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 'USING BTREE, ADD KEY `condition` (`condition`,`id_product`) USING B' at line 2
 

ALTER TABLE ps_cat_restriction ADD PRIMARY KEY (id_product),													ADD KEY `id_manufacturer` (`id_manufacturer`,`id_product`) USING BTREE,													ADD KEY `condition` (`condition`,`id_product`) USING BTREE,													ADD KEY `weight` (`weight`,`id_product`) USING BTREE

at line 623 in file classes/db/Db.php

617. 			WebserviceRequest::getInstance()->setError(500, '[SQL Error] '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97);618. 		}619. 		else if (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS'))620. 		{621. 			if ($sql)622. 				throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>');623. 			throw new PrestaShopDatabaseException($this->getMsgError());624. 		}625. 	}626. 627. 	/**
Link to comment
Share on other sites


It is a bug in that SQL query. It looks like that query should work well in MySQL 5.0, but shouldn't in later versions.

 

Try (in /modules/blocklayered/blocklayered.php)

 

...

ADD KEY `id_manufacturer` USING BTREE (`id_manufacturer`,`id_product`),


...

 

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