首页 > 解决方案 > 类/db/Db.php 中的 Prestashop 错误错误

问题描述

我有以下错误

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 '-12' at line 8<pre>SELECT cp.`id_product` FROM `devapp_product` p INNER JOIN devapp_product_shop product_shop ON (product_shop.id_product = p.id_product AND product_shop.id_shop = 1) LEFT JOIN `devapp_category_product` cp ON p.`id_product` = cp.`id_product` WHERE cp.`id_category` = 10 AND product_shop.`visibility` IN ("both", "catalog") ORDER BY p.date_add DESC LIMIT -12</pre>
at line 770 in file classes/db/Db.php


765.             $dbg = debug_backtrace();
766.             WebserviceRequest::getInstance()->setError(500, '[SQL Error] ' . $this->getMsgError() . '. From ' . (isset($dbg[3]['class']) ? $dbg[3]['class'] : '') . '->' . $dbg[3]['function'] . '() Query was : ' . $sql, 97);
767.         } elseif (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS')) {
768.             if ($sql) {
769.             //    throw new PrestaShopDatabaseException($this->getMsgError() . '<br /><br /><pre>' . $sql . '</pre>');
770.                 throw new PrestaShopDatabaseException($this->getMsgError() . '<pre>' . $sql . '</pre>');
771.             }
772. 
773.             throw new PrestaShopDatabaseException($this->getMsgError());
774.         }
775.     }


----------
DbCore->displayError - [line 385 - classes/db/Db.php] - [1 Arguments]
DbCore->query - [line 613 - classes/db/Db.php] - [1 Arguments]
DbCore->executeS - [line 260 - modules/strelatedproducts/strelatedproducts.php] - [1 Arguments]
StRelatedProducts->getProducts - [line 528 - modules/stthemeeditor/classes/BaseProductsSlider.php] - [1 Arguments]
BaseProductsSlider->_prepareHook - [line 648 - modules/stthemeeditor/classes/BaseProductsSlider.php] - [1 Arguments]
BaseProductsSlider->hookDisplayLeftColumn - [line 326 - modules/strelatedproducts/strelatedproducts.php] - [2 Arguments]

有没有人有类似的问题...,当新用户创建帐户时无法在购物篮中添加产品。

标签: prestashop-1.7prestashop-modulesprestashop-helper-classes

解决方案


推荐阅读