Forums / General Questions / Fatal Error: "Unknown Column" -- HELP

Fatal Error: "Unknown Column" -- HELP

Locked

Views: 1,167

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
22 Dec 2006, 8:14 PM
#1
gary avatar

gary

New Zenner

Join Date:
Jul 2005
Posts:
3
Plugin Contributions:
0

Fatal Error: "Unknown Column" -- HELP

This happened sometime over the past 8 days. I can no longer get to my main page with my online catalog. Instead, I see this message:

1054 Unknown column 'p.products_id' in 'on clause'

Was my site tampered with? Everything has been fine on my site since I launched it over a year and a half ago.

Has anyone had experience with this error message before, and can anyone offer me a tip on how to fix it?

I haven't made any changes to the site for nearly a year. I'm using an older version of Zen-Cart. I'm not sure how to determine which version it is. I don't see anything on the Admin page that indicates which version I'm using.

22 Dec 2006, 10:19 PM
#2
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,684
Plugin Contributions:
0

Re: Fatal Error: "Unknown Column" -- HELP

A search for p.products_id came up with 222 hits, perhaps one of them can help.

As an aside, you really need to upgrade your site as it is vulnerable to several exploits.

Please do not PM for support issues: a private solution doesn't benefit the community.

Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

23 Dec 2006, 4:02 AM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Fatal Error: "Unknown Column" -- HELP

You can see your Zen Cart version number under Admin->Tools->Server Info

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

23 Dec 2006, 4:03 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Fatal Error: "Unknown Column" -- HELP

gary:

1054 Unknown column 'p.products_id' in 'on clause'

This message was very typical of sites which upgraded their PHP code but didn't upgrade their database too.
Thus, this would suggest that either you've installed a mod designed for a newer version of Zen Cart, or you've begun a site-upgrade and done a partial update of PHP files but haven't upgraded the database too.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

29 Dec 2006, 7:35 PM
#5
gary avatar

gary

New Zenner

Join Date:
Jul 2005
Posts:
3
Plugin Contributions:
0

Re: Fatal Error: "Unknown Column" -- HELP

Thanks Dr. Byte but in fact I did nothing with the site. Something happened between 12/14, when the last order was placed, and 12/22, when I did a random check of the site. At that time I tried to go into the store and saw the error message. It was nothing I did. I have not installed any mods or done a partial upgrade. The site has been left alone since it was launched in 7/2005. The only thing that's been done is we've gone into the admin side to pick up order details when we were notified of new orders.

The fact is now I'm totally lost and don't know what to do. The upgrade instructions are inscrutable. I'm running ZC 2.5 and know I need to upgrade the site. However, the host only allows one database, so I can't figure out how I'm supposed to do the upgrade without losing everything I currently have. I uploaded the latest version 3.6 and went through the zc_install part but had to quit when it came to the database part because I don't want to overwrite the existing database.

The people at Zen Cart sure didn't think of non-geek end users when putting together upgrade packages.

29 Dec 2006, 8:28 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Fatal Error: "Unknown Column" -- HELP

gary:

This happened sometime over the past 8 days. I can no longer get to my main page with my online catalog. Instead, I see this message:

1054 Unknown column 'p.products_id' in 'on clause'

Was my site tampered with? Everything has been fine on my site since I launched it over a year and a half ago.

Okay, let's look at it from another angle. If accessing the "p.products_id" column reports an error, then that means that the table referenced by "p" (usually the "products" table) is missing the expected field/column named "products_id".

If you've made no known changes to your database or PHP files, then ... something or someone has.

It could be that the PHP files on your site have been altered to request data from the products_id field.
Or it could be that your database has been damaged somehow and is missing or cannot successfully access the products_id field.

Either way, this situation is not usually a quick-fix for a "non-geek" (as you call it) situation.

I would start with:

  1. Open phpMyAdmin. Select your database. One at a time, click on EACH table shown on the left, and for each you need to click on the "Operations" tab on the top right. Then on that page, click Repair Table. Repeat for each table in your left-hand column.

  2. Evaluate all your PHP files, comparing them with the backup copy you have on your PC, or with an original fileset for your version of Zen Cart (I believe you meant v1.2.5?). Here's a tip on how to do that: http://www.zen-cart.com/wiki/index.php/Troubleshoot_-_Diagnosing_Obscure_Issues

  3. You might ask your webhost if they had any problems recently and whether they had to restore any files or recover from any database damages. Perhaps something they did may be affecting you.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.