Witam,

Po wyszukaniu jakiegoś fragmentu tekstu w wyszukiwarce wyświetlany mam komunikat:
  1. 1054 - Unknown column 'p.products_id' in 'on clause'
  2.  
  3. select count(distinct p.products_image) as total from products p left join manufacturers m ON p.manufacturers_id = m.manufacturers_id, products_description pd left join specials s on p.products_id = s.products_id, categories c, products_to_categories p2c where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '4' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and ((pd.products_name like '%asas%' or p.products_model like '%asas%' or m.manufacturers_name like '%asas%') )
  4.  
  5. [TEP STOP]


za wyszukiwanie odpowiada plik advanced_search_result.php

Wiem już że to jest błąd związany z wersją MySQL -> nowa wersja to 5.0

Wiem również że fragment kodu:
  1. using(manufacturers_id)

trzeba zamienić na
  1. ON p.manufacturers_id = m.manufacturers_id


Wiem również że trzeba w zapytaniu dorzucić nawiasy.

Tylko teraz niestety nie wiem gdzie
  1. $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";
  2.  
  3. if ( (DISPLAY_PRICE_WITH_TAX == 'true') && (tep_not_null($pfrom) || tep_not_null($pto)) ) {
  4. if (!tep_session_is_registered('customer_country_id')) {
  5. $customer_country_id = STORE_COUNTRY;
  6. $customer_zone_id = STORE_ZONE;
  7. }
  8. $from_str .= " left join " . TABLE_TAX_RATES . " tr on p.products_tax_class_id = tr.tax_class_id left join " . TABLE_ZONES_TO_GEO_ZONES . " gz on tr.tax_zone_id = gz.geo_zone_id and (gz.zone_country_id is null or gz.zone_country_id = '0' or gz.zone_country_id = '" . (int)$customer_country_id . "') and (gz.zone_id is null or gz.zone_id = '0' or gz.zone_id = '" . (int)$customer_zone_id . "')";
  9. }
  10.  
  11. $where_str = " where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id ";



Większość wygooglowanych informacji na temat tego błędu odnosi się do plików np. index.php
Nie udało znaleźć mi się informacji o błędzie który występuje tylko w wyszukiwaniu.

Z góry dziękuję za poświęcony czas.