[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 'AND id_product = 5022 LIMIT 1' at line 4

            SELECT position
			FROM ps_category_product
            WHERE id_category = 
            AND id_product = 5022 LIMIT 1

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

641. 			WebserviceRequest::getInstance()->setError(500, '[SQL Error] '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97);
642. 		}
643. 		elseif (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS'))
644. 		{
645. 			if ($sql)
646. 				throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>');
647. 			throw new PrestaShopDatabaseException($this->getMsgError());
648. 		}
649. 	}
650. 
651. 	/**