2011-12-12 127 views
0

我在我的Magento異常日誌中遇到了很多以下錯誤。有誰知道我會如何解決這個問題?Magento - 1064您的SQL語法錯誤錯誤

2011-12-10T22:13:41+00:00 ERR (3): 
exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 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 ')' at line 1' in /home/mysite/public_html/lib/Zend/Db/Statement/Pdo.php:228 
Stack trace: 
#0 /home/mysite/public_html/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array) 
#1 /home/mysite/public_html/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array) 
#2 /home/mysite/public_html/lib/Zend/Db/Statement.php(300): Varien_Db_Statement_Pdo_Mysql->_execute(Array) 
#3 /home/mysite/public_html/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array) 
#4 /home/mysite/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `catalog...', Array) 
#5 /home/mysite/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(389): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `catalog...', Array) 
#6 /home/mysite/public_html/lib/Zend/Db/Adapter/Abstract.php(753): Varien_Db_Adapter_Pdo_Mysql->query(Object(Varien_Db_Select), Array) 
#7 /home/mysite/public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(375): Zend_Db_Adapter_Abstract->fetchRow(Object(Varien_Db_Select)) 
#8 /home/mysite/public_html/app/code/core/Mage/Core/Model/Abstract.php(225): Mage_Core_Model_Resource_Db_Abstract->load(Object(Mage_Catalog_Model_Category), Object(Mage_Catalog_Model_Category), NULL) 
#9 /home/mysite/public_html/app/code/local/Mage/Catalog/Block/Product/Newcustom.php(80): Mage_Core_Model_Abstract->load(Object(Mage_Catalog_Model_Category)) 
#10 /home/mysite/public_html/app/code/local/Mage/Catalog/Block/Product/Newcustom.php(145): Mage_Catalog_Block_Product_Newcustom->_getProductCollection() 
#11 /home/mysite/public_html/app/code/core/Mage/Core/Block/Abstract.php(862): Mage_Catalog_Block_Product_Newcustom->_beforeToHtml() 
#12 /home/mysite/public_html/app/code/core/Mage/Core/Model/Email/Template/Filter.php(191): Mage_Core_Block_Abstract->toHtml() 
#13 [internal function]: Mage_Core_Model_Email_Template_Filter->blockDirective(Array) 
#14 /home/mysite/public_html/lib/Varien/Filter/Template.php(134): call_user_func(Array, Array) 
#15 /home/mysite/public_html/app/code/core/Mage/Core/Model/Email/Template/Filter.php(502): Varien_Filter_Template->filter('<h3>New Watches...') 
#16 /home/mysite/public_html/app/code/core/Mage/Cms/Block/Block.php(54): Mage_Core_Model_Email_Template_Filter->filter('<h3>New Watches...') 
#17 /home/mysite/public_html/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Cms_Block_Block->_toHtml() 
#18 /home/mysite/public_html/app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml() 
#19 /home/mysite/public_html/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Text_List->_toHtml() 
#20 /home/mysite/public_html/app/code/core/Mage/Core/Block/Abstract.php(582): Mage_Core_Block_Abstract->toHtml() 
#21 /home/mysite/public_html/app/code/core/Mage/Core/Block/Abstract.php(526): Mage_Core_Block_Abstract->_getChildHtml('right', true) 
#22 /home/mysite/public_html/app/design/frontend/default/twistedtime/template/page/2columns-right.phtml(56): Mage_Core_Block_Abstract->getChildHtml('right') 
#23 /home/mysite/public_html/app/code/local/Mage/Core/Block/Template.php(469): include('/home/mysite/...') 
#24 /home/mysite/public_html/app/code/local/Mage/Core/Block/Template.php(531): Mage_Core_Block_Template->fetchView('frontend/defaul...') 
#25 /home/mysite/public_html/app/code/local/Mage/Core/Block/Template.php(559): Mage_Core_Block_Template->renderView() 
#26 /home/mysite/public_html/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Template->_toHtml() 
#27 /home/mysite/public_html/app/code/core/Mage/Core/Model/Layout.php(529): Mage_Core_Block_Abstract->toHtml() 
#28 /home/mysite/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(391): Mage_Core_Model_Layout->getOutput() 
#29 /home/mysite/public_html/app/code/core/Mage/Catalog/Helper/Product/View.php(147): Mage_Core_Controller_Varien_Action->renderLayout() 
#30 /home/mysite/public_html/app/code/core/Mage/Catalog/controllers/ProductController.php(132): Mage_Catalog_Helper_Product_View->prepareAndRender(27, Object(Mage_Catalog_ProductController), Object(Varien_Object)) 
#31 /home/mysite/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(420): Mage_Catalog_ProductController->viewAction() 
#32 /home/mysite/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('view') 
#33 /home/mysite/public_html/app/code/community/ArtsOnIT/OfflineMaintenance/Controller/Router/Standard.php(46): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http)) 
#34 /home/mysite/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(176): ArtsOnIT_OfflineMaintenance_Controller_Router_Standard->match(Object(Mage_Core_Controller_Request_Http)) 
#35 /home/mysite/public_html/app/code/core/Mage/Core/Model/App.php(349): Mage_Core_Controller_Varien_Front->dispatch() 
#36 /home/mysite/public_html/app/Mage.php(640): Mage_Core_Model_App->run(Array) 
#37 /home/mysite/public_html/index.php(80): Mage::run('', 'store') 
#38 {main} 

回答

0

檢查您的_getProductCollection函數中的過濾器。如果你沒有,那麼檢查你所有的自定義模型的init方法。