Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Error 1064 with Search. Help !


doctorTheo

Recommended Posts

Hello

 

When I use the search and/or advanced search i receive an error 1064:

 

1064 - You have an error in your SQL syntax near 'distinct p.products_id) as total from products p left join manufacturers m usin' at line 1

 

select count(distinct p.products_id) as total from products p left join manufacturers m using(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 '%ass%' or p.products_model like '%ass%' or m.manufacturers_name like '%ass%') )

 

***

 

Any idea how to solve the problem? I am completely new to PHP/Mysql !

 

Thanks

 

Theo

Link to comment
Share on other sites

Problem solved

 

I found out the problem. There is a bug in the file

 

catalog/advanced_search_result.php

 

Near line 207 there is this code:

 

$select_str = "select distinct " . $select_column_list . " m.manufacturers_id, p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price ";

 

*******You must remove "distinct" for the Search/advanced search to work

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...