Unknown column error after upgrade

Post-upgrade blank screen when adding a record

If you get a message like,

PHP Fatal error: 1054:Unknown column 'c.customers_secret' in 'field list' ...


PHP Fatal error: 1054:Unknown column 'o.language_code' in 'field list' ...

What is happening is that one or more of the ALTER TABLE commands in the upgrade process run by zc_install failed, and now a column which is expected to exist does not.

One very common root cause for this issue is a failure running an ALTER TABLE required by an upgrade because the table in question still has old format dates. See the page date standardization for instructions on how to fix this.

Note: Once you fix the issue that caused the ALTER TABLE to fail, you will still need to run the original command to add the new field. You may do this in phpMyAdmin or in Admin > Tools > Install SQL Patches. Example:

ALTER TABLE orders ADD language_code char(2) NOT NULL default '';

Still have questions? Use the Search box in the upper right, or try the full list of FAQs. If you can't find it there, head over to the Zen Cart support forum and ask there in the appropriate subforum. In your post, please include your Zen Cart and PHP versions, and a link to your site.

Is there an error or omission on this page? Please post to General Questions on the support forum. Or, if you'd like to open a pull request, just review the guidelines and get started. You can even PR right here.
Last modified November 29, 2021 by Scott C Wilson (4d7f100).