Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product Search broken


jhande

Recommended Posts

I just found out that my Product Search is broken. :blush:

When I type a word to search for I receive this error message -

 

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

 

select count(distinct p.products_id) as total from products p left join manufacturers m using(manufacturers_id) left join specials s on pd.products_id = s.products_id, products_description pd, categories c, products_to_categories p2c where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and ((pd.products_name like '%revell%' or p.products_model like '%revell%' or m.manufacturers_name like '%revell%') )

 

[TEP STOP]

 

I really don't know for how long this function has been broke. I do know I just installed the contribution - More Category Boxes 1.0.

Is it possible that the contrib broke it?

I searched my database through phpMyAdmin and found listings for product_id in these tables = order_products, products, product_attributes, products_description, products_notifications, products_to_categories, and reviews.

 

I have not made any changes to...

 

catalog > includes > boxes > search.php

catalog > advanced_search.php

catalog > advanced_search_result.php

 

...since I knew it last worked.

 

Any ideas before I delete the contribution and restore my database? :huh:

- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Link to comment
Share on other sites

I just found out that my Product Search is broken. :blush:

When I type a word to search for I receive this error message -

 

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

 

Any ideas before I delete the contribution and restore my database? :huh:

I would say you just hit the standard 1054 error in advanced_search_results.php caused by MySQL5. I think that was resolved in MS2.2 060817 already but perhaps you installed a contribution with old code over the updated version.

Link to comment
Share on other sites

Thanks for the reply Jan ;)

 

After I un-installed the More Categories contrib with no resolve, I searched the advanced_search_result.php file.

 

I found a nasty little d in the code.

 

$from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id) left join " . TABLE_SPECIALS . " s on pd.products_id = s.products_id";

 

What had me stumped was that I haven't edited that file in a long time and all was working fine (I had previously fixed files after my host updated to MySQL 5). Plus the above string of code doesn't quite match what is stated in the contrib fix -

Find this:

$from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c";

----------------------------------------

and replace with this:

$from_str = "from ((" . TABLE_PRODUCTS . " p) left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c";

 

Strange goings on... :blink:

 

But all seems fine now that the nasty d is gone. ;)

- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Link to comment
Share on other sites

But all seems fine now that the nasty d is gone. ;)

Yeah you are right. This had nothing to do with the MySQL5 1054 error. Glad you found it because such a small typo is hard to find.

Link to comment
Share on other sites

Yeah you are right. This had nothing to do with the MySQL5 1054 error. Glad you found it because such a small typo is hard to find.

 

Thanks Jan!

 

Although I know nothing regarding PHP and MySQL, I'm slowly learning what to look for do to working on my site.

 

Hmmm... Maybe I do know something since I'm getting the hang of finding and fixing my problems? Nah... :lol:

 

;)

- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...