Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Myster Error


keress

Recommended Posts

Posted

A client's cart crashed over the weekened, apparently some files became corrupted. In order to repair I re-uploaded the site. I have tried recreating the database with both a backup made after the crash, and a downlevel one several months old.

 

In trying to access any category pages we get this error:

 

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

 

select count(p.products_id) as total from products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '1' and p2c.categories_id = '24'

 

[TEP STOP]

 

What does the "p" in "p.products_id" signify? Perhaps that will give me a clue to where the problem is. I can't find any "p.products_id" in either the database or the catalog.

Posted

p. relates to the table this comes from, so p.products_id is most likely from the products table. If you look a little further along the sql statement in whichever file cause you this error, it will probably state FROM (" . TABLE_PRODUCTS . ") p,

Posted

That code doesnt appear in any of the files that I know of. Do me a favour, open your index.php and search for

 

select count(p.products_id)

 

And post the whole sql statement for me. I cant figure why you would ask to count the products_id at this point

 

Just as a possible solution which may work (although your script will still be wrong), try turning category counts off in admin, see if that fixes anything..?

Posted

Great, I get a "Page cannot be displayed" in Admin and in pHpAdmin it says. "PMA Database ... not OK General relation features Disabled" It says this when created from a recent backup and from a backup from August.

 

Admin was working yesterday. . .

Posted

Okay, admin is working. I can't find anywhere to turn off category counts.

 

In the index.php file, I can't find the statement "select count(p.products_id)" in this file, when I try to search the whole site, Dreamweaver crashes when it gets to "stats/error file. I do find "p.products_id" in a number of places, should I copy them over?

Posted

I set category counts to false, but still the same error as above.

 

I'm downloading the upgrade now. Is there some reason the site, which had been working fine for months, would suddenly have problems that this upgrade would fix?

Posted

the update was released near the end of 05 so its quite recent. You could read the modification instructions and check few files if in doubt. Also the category counts won't necessarily fix the error. Its just how to use it.

Posted

Okay, the web host is supposed to provide us with some backups from last week. If that doesn't fix the problem, I'll try the upgrade next. Thanks much.

Posted

The web host does not have the backups they expected would be there.

 

I downloaded the upgrade, but couldn't find any differences with what I have installed. I'm on osc2.2 ms2 v 4.4.2. I checked the modification dates for the files on the root and in the "install" directory and couldn't see any differences. I have some contribs installed, so I'd have to upgrade manually, but don't see what files might be different. Is there a better way to do this?

 

I've been studying the code around where the error occurs. Anywhere the word "COUNT" occurs, or "p.products_id" occurs, the code is the same as in the "out-of-the-box" index.php file.

 

I do have "header tags" contrib installed, and there are changes from that near where the error occurs. I've posted a question on that thread. I checked that the database online has the table changes from the contribution. It was missing some, but disappointingly, adding them didn't fix the problem. I've looked for other database discrepancies concerning contrib alterations, but didn't find any.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...