Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

1054 Unknown column ‘website_ids’ in ‘where clause’’
 
webikadesign
Jr. Member
 
Avatar
Total Posts:  22
Joined:  2008-12-30
 

We have upgraded magento to 1.7 from 1.5 and getting error message.

Next exception ‘Zend_Db_Statement_Exception’ with message ‘SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘website_ids’ in ‘where clause’’ in /shop/lib/Zend/Db/Statement/Pdo.php:234

I would appreciate any advise. This error is affecting somehow the store that we can not add a product to a cart.

Thank you

 
Magento Community Magento Community
Magento Community
Magento Community
 
JDS80
Member
 
Total Posts:  56
Joined:  2009-02-09
 

Im having the same problem,
Did you find the solution ?

Regards
Johan

 
Magento Community Magento Community
Magento Community
Magento Community
 
kalenjordan
Sr. Member
 
Avatar
Total Posts:  218
Joined:  2011-10-31
Pasadena, CA
 

Hey guys, can you post a full strack trace?  That exception is pretty deep in the execution stack in the Zend DB layer, so it’s hard to say what the root cause might be.

 
Magento Community Magento Community
Magento Community
Magento Community
 
JDS80
Member
 
Total Posts:  56
Joined:  2009-02-09
 

Thanks for your reply.
Here is my full log message.

Ive upgraded from 1.4.1.1 and to 1.4.2 then to 1.7.0.2 and i think i didnt upgrade the database at 1.4.2 .

Maybe thats the problem ill do it all over again and see if that does it.

Regards
Johan

2012-11-09T23:10:36+00:00 DEBUG (7): Exception message: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘website_ids’ in ‘where clause’
Trace: #0 /home/magento/public_html/kabelbutiken.com/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
#1 /home/magento/public_html/kabelbutiken.com/lib/Zend/Db/Statement.php(300): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
#2 /home/magento/public_html/kabelbutiken.com/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#3 /home/magento/public_html/kabelbutiken.com/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query(’SELECT `main_ta...’, Array)
#4 /home/magento/public_html/kabelbutiken.com/lib/Varien/Db/Adapter/Pdo/Mysql.php(419): Zend_Db_Adapter_Pdo_Abstract->query(’SELECT `main_ta...’, Array)
#5 /home/magento/public_html/kabelbutiken.com/lib/Zend/Db/Adapter/Abstract.php(734): Varien_Db_Adapter_Pdo_Mysql->query(’SELECT `main_ta...’, Array)
#6 /home/magento/public_html/kabelbutiken.com/lib/Varien/Data/Collection/Db.php(734): Zend_Db_Adapter_Abstract->fetchAll(’SELECT `main_ta...’, Array)
#7 /home/magento/public_html/kabelbutiken.com/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php(521): Varien_Data_Collection_Db->_fetchAll(’SELECT `main_ta...’, Array)
#8 /home/magento/public_html/kabelbutiken.com/lib/Varien/Data/Collection/Db.php(566): Mage_Core_Model_Resource_Db_Collection_Abstract->getData()
#9 /home/magento/public_html/kabelbutiken.com/app/code/core/Mage/SalesRule/Model/Validator.php(100): Varien_Data_Collection_Db->load()
#10 /home/magento/public_html/kabelbutiken.com/app/code/core/Mage/SalesRule/Model/Quote/Freeshipping.php(60): Mage_SalesRule_Model_Validator->init(’2’, 0, NULL)
#11 /home/magento/public_html/kabelbutiken.com/app/code/core/Mage/Sales/Model/Quote/Address.php(957): Mage_SalesRule_Model_Quote_Freeshipping->collect(Object(Mage_Sales_Model_Quote_Address))
#12 /home/magento/public_html/kabelbutiken.com/app/code/core/Mage/Sales/Model/Quote.php(1263): Mage_Sales_Model_Quote_Address->collectTotals()
#13 /home/magento/public_html/kabelbutiken.com/app/code/core/Mage/Checkout/Model/Cart.php(464): Mage_Sales_Model_Quote->collectTotals()
#14 /home/magento/public_html/kabelbutiken.com/app/code/core/Mage/Checkout/controllers/CartController.php(198): Mage_Checkout_Model_Cart->save()
#15 /home/magento/public_html/kabelbutiken.com/app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Checkout_CartController->addAction()
#16 /home/magento/public_html/kabelbutiken.com/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch(’add’)
#17 /home/magento/public_html/kabelbutiken.com/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#18 /home/magento/public_html/kabelbutiken.com/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#19 /home/magento/public_html/kabelbutiken.com/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#20 /home/magento/public_html/kabelbutiken.com/index.php(87): Mage::run(’’, ‘store’)
#21 {main}

 
Magento Community Magento Community
Magento Community
Magento Community
 
kalenjordan
Sr. Member
 
Avatar
Total Posts:  218
Joined:  2011-10-31
Pasadena, CA
 

Hey @Johan, OK so it looks like it’s your salesrule_rule table that’s missing a website_id column. 

This is the section of code where the exception is originating.

// Mage_SalesRule_Model_Validator
$this->_rules[$key] Mage::getResourceModel('salesrule/rule_collection')
    ->
setValidationFilter($websiteId$customerGroupId$couponCode)
    ->
load();

If that table didn’t get the website_id added in the upgrade process, there’s a good chance that there were other problems.  You should probably check your exception log to see whether any other problems occurred.

 
Magento Community Magento Community
Magento Community
Magento Community
 
zhartaunik
Jr. Member
 
Total Posts:  2
Joined:  2013-01-21
 

Try to find module Amasty_coupons and disable it. It helped me.

 
Magento Community Magento Community
Magento Community
Magento Community
 
GoMageTeam
Guru
 
Avatar
Total Posts:  356
Joined:  2013-01-13
Warsaw, Poland
 

Hello,

Please, check the following information to solve the problem: http://www.magentocommerce.com/boards/viewthread/310317/

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top