mysql - Magento - 注册错误 - 1054 'ca.sort_order' 中的未知列 'order clause'

标签 mysql magento mysql-error-1054

当我尝试在我的 Magento 商店中创建新帐户时收到此错误。

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'ca.sort_order' in 'order clause'
/home/user/public_html/lib/Zend/Db/Statement.php(300): Zend_Db_Statement_Pdo->_execute(Array)
/home/user/public_html/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
/home/user/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `main_ta...', Array)
/home/user/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(333): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `main_ta...', Array)
/home/user/public_html/lib/Zend/Db/Adapter/Abstract.php(734): Varien_Db_Adapter_Pdo_Mysql->query(Object(Varien_Db_Select), Array)
/home/user/public_html/lib/Varien/Data/Collection/Db.php(783): Zend_Db_Adapter_Abstract->fetchAll(Object(Varien_Db_Select), Array)
/home/user/public_html/lib/Varien/Data/Collection/Db.php(696): Varien_Data_Collection_Db->_fetchAll(Object(Varien_Db_Select))
/home/user/public_html/lib/Varien/Data/Collection/Db.php(617): Varien_Data_Collection_Db->getData()
/home/user/public_html/lib/Varien/Data/Collection.php(729): Varien_Data_Collection_Db->load()
/home/user/public_html/app/code/core/Mage/Customer/Model/Form.php(222): Varien_Data_Collection->getIterator()
/home/user/public_html/app/code/core/Mage/Customer/Model/Form.php(320): Mage_Customer_Model_Form->getAttributes()
/home/user/public_html/app/code/core/Mage/Customer/controllers/AccountController.php(262): Mage_Customer_Model_Form->extractData(Object(Mage_Core_Controller_Request_Http))
/home/user/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Customer_AccountController->createPostAction()
/home/user/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(253): Mage_Core_Controller_Varien_Action->dispatch('createpost')
/home/user/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
/home/user/public_html/app/code/core/Mage/Core/Model/App.php(340): Mage_Core_Controller_Varien_Front->dispatch()
/home/user/public_html/app/Mage.php(627): Mage_Core_Model_App->run(Array)
/home/user/public_html/index.php(80): Mage::run('', 'store')
{main}

一些背景信息:我使用的是为 1.4.x 构建的模板,但我目前使用的是 1.5.0.1 稳定版。

我尝试了在此处找到的 SQL 修复:http://www.magentocommerce.com/boards/viewthread/214185/#top但它没有用。有什么想法吗?

编辑:网站位于http://allyourga.me

编辑 2:删除错误,因为它们不相关

最佳答案

问题是我的数据库有严重缺陷。我怀疑问题可能是在从购买的 Magento 模板上传示例数据时出现的,或者是在我将网站从一台服务器迁移到新服务器时出现的。

我通过运行 Magento 的数据库修复工具来修复它,该工具可以在以下链接中找到:http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/db-repair-tool

弹出的错误有很多 Added missing foreign key(s) 和两个 Added missing fields。有关弹出错误的完整报告,请转到以下 Stack Overflow 问题:

Magento - Database repair tool - Added missing foreign keys problems

关于mysql - Magento - 注册错误 - 1054 'ca.sort_order' 中的未知列 'order clause',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5712762/

相关文章:

php - 如何在 PHP 5.5 中使用 password_needs_rehash 函数

mysql - 根据排名和先前选择的行选择行

php - 观察者不保存订单

php - Magento "Special Price From Date"不工作

mysql - 无法在 MySQL 中使用外键插入值

mysql - 我可以在 SELECT 查询中重复使用计算字段吗?

php - 是否可以直接在 MYSQL 查询中而不是在 PHP 中执行此算术运算?

mysql - 将 mysql 数据库导出到 csv 文件的工具

Magento XML - cms_index_index 和 cms_index_defaultindex 的区别

mysql - #1054 - 未知列 - SQL 查询问题