产品视图上的Magento SQLSTATE [42000]

时间:2012-03-15 10:44:50

标签: mysql zend-framework magento e-commerce

我目前正在与magento在线商店工作。一切都很好,并按照我想要的方式进行。但是当我尝试获取产品视图时,我突然收到此错误消息。

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

奇怪的是,我只更改了一些布局和模板文件,但它们与我的单一产品视图页面无关。我没有更改任何与核心相关的文件或任何带有SQL查询的文件。 我查看了我编辑的页面,但似乎没有错。

也许这是一些已知的错误。在另一个线程上,我读到我必须清除我的错误日志/错误表,但这没有做任何事情。

感谢任何帮助。 提前谢谢。

  • 菲利普

3 个答案:

答案 0 :(得分:0)

  1. 清理缓存
  2. 检查您执行以下操作的每个陈述:
  3.     addAttributeToFilter...
        $collection->getSelect...
    

    或类似的东西。因为可能是你改变了一些过滤器或移除了一些块或者做了一些错字。

答案 1 :(得分:0)

你的问题非常模糊。鉴于缺乏信息,我只能建议一种标准的调试方法。

  1. 将主题恢复为base/default并查看错误是否仍然存在
  2. app/code/local目录重命名为app/code/local.bak并查看错误是否仍然存在
  3. app/code/community目录重命名为app/code/community.bak并查看错误是否仍然存在
  4. 恢复app/code/core目录的干净版本(以防恶意开发人员对其进行修改)
  5. 恢复lib目录的干净版本(再次,以防恶意开发者修改它)
  6. 放弃希望

答案 2 :(得分:0)

处理您的请求时出错 SQLSTATE [42000]:语法错误或访问冲突:1064 SQL语法中有错误;检查与MySQL服务器版本对应的手册,以便在第1行的')'附近使用正确的语法

跟踪:

#0 /home/admin/domains/vinatoppro.com/public_html/lib/Zend/Db/Statement.php(300): Zend_Db_Statement_Pdo->_execute(Array)
#1 /home/admin/domains/vinatoppro.com/public_html/lib/Zend/Db/Adapter/Abstract.php(468): Zend_Db_Statement->execute(Array)
#2 /home/admin/domains/vinatoppro.com/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `catalog...', Array)
#3 /home/admin/domains/vinatoppro.com/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(333): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `catalog...', Array)
#4 /home/admin/domains/vinatoppro.com/public_html/lib/Zend/Db/Adapter/Abstract.php(725): Varien_Db_Adapter_Pdo_Mysql->query(Object(Varien_Db_Select), Array)
#5 /home/admin/domains/vinatoppro.com/public_html/app/code/core/Mage/Eav/Model/Entity/Abstract.php(844): Zend_Db_Adapter_Abstract->fetchRow(Object(Varien_Db_Select))
#6 /home/admin/domains/vinatoppro.com/public_html/app/code/core/Mage/Catalog/Model/Resource/Eav/Mysql4/Abstract.php(630): Mage_Eav_Model_Entity_Abstract->load(Object(Mage_Catalog_Model_Category), Object(Mage_Catalog_Model_Category), NULL)
#7 /home/admin/domains/vinatoppro.com/public_html/app/code/core/Mage/Core/Model/Abstract.php(225): Mage_Catalog_Model_Resource_Eav_Mysql4_Abstract->load(Object(Mage_Catalog_Model_Category), Object(Mage_Catalog_Model_Category), NULL)
#8 /home/admin/domains/vinatoppro.com/public_html/app/code/core/Mage/Catalog/Block/Product/List.php(80): Mage_Core_Model_Abstract->load(Object(Mage_Catalog_Model_Category))
#9 /home/admin/domains/vinatoppro.com/public_html/app/code/core/Mage/Catalog/Block/Product/List.php(133): Mage_Catalog_Block_Product_List->_getProductCollection()
#10 /home/admin/domains/vinatoppro.com/public_html/app/code/core/Mage/Core/Block/Abstract.php(752): Mage_Catalog_Block_Product_List->_beforeToHtml()
#11 /home/admin/domains/vinatoppro.com/public_html/app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()
#12 /home/admin/domains/vinatoppro.com/public_html/app/code/core/Mage/Core/Block/Abstract.php(753): Mage_Core_Block_Text_List->_toHtml()
#13 /home/admin/domains/vinatoppro.com/public_html/app/code/core/Mage/Core/Block/Abstract.php(520): Mage_Core_Block_Abstract->toHtml()
#14 /home/admin/domains/vinatoppro.com/public_html/app/code/core/Mage/Core/Block/Abstract.php(471): Mage_Core_Block_Abstract->_getChildHtml('featuredproduct...', true)
#15 /home/admin/domains/vinatoppro.com/public_html/app/design/frontend/default/thungracnhua/template/page/2columns-left.phtml(66): Mage_Core_Block_Abstract->getChildHtml('featuredproduct...')
#16 /home/admin/domains/vinatoppro.com/public_html/app/code/core/Mage/Core/Block/Template.php(212): include('/home/admin/dom...')
#17 /home/admin/domains/vinatoppro.com/public_html/app/code/core/Mage/Core/Block/Template.php(239): Mage_Core_Block_Template->fetchView('frontend/defaul...')
#18 /home/admin/domains/vinatoppro.com/public_html/app/code/core/Mage/Core/Block/Template.php(253): Mage_Core_Block_Template->renderView()
#19 /home/admin/domains/vinatoppro.com/public_html/app/code/core/Mage/Core/Block/Abstract.php(753): Mage_Core_Block_Template->_toHtml()
#20 /home/admin/domains/vinatoppro.com/public_html/app/code/core/Mage/Core/Model/Layout.php(529): Mage_Core_Block_Abstract->toHtml()
#21 /home/admin/domains/vinatoppro.com/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(389): Mage_Core_Model_Layout->getOutput()
#22 /home/admin/domains/vinatoppro.com/public_html/app/code/core/Mage/Catalog/controllers/ProductController.php(153): Mage_Core_Controller_Varien_Action->renderLayout()
#23 /home/admin/domains/vinatoppro.com/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Catalog_ProductController->viewAction()
#24 /home/admin/domains/vinatoppro.com/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('view')
#25 /home/admin/domains/vinatoppro.com/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(177): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#26 /home/admin/domains/vinatoppro.com/public_html/app/code/core/Mage/Core/Model/App.php(304): Mage_Core_Controller_Varien_Front->dispatch()
#27 /home/admin/domains/vinatoppro.com/public_html/app/Mage.php(596): Mage_Core_Model_App->run(Array)
#28 /home/admin/domains/vinatoppro.com/public_html/index.php(80): Mage::run('', 'store')
#29 {main}

网站:http://vinatoppro.com