Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

v2.2 MS2 Search Feature Problem


Recommended Posts

In the new version of Osc, v2.2 MS2, when someone uses the search function, they get the following error...


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 = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and ((pd.products_name like '%world%' or p.products_model like '%world%' or m.manufacturers_name like '%world%') )




Any ideas folks???


It happens on all three of my sites using v2.2 MS2 of osC.


Thanks in advance!

Link to comment
Share on other sites

Hey, I just had this problem...


Anyway, sounds like you might have a version of mySQL older than 4. In this case, your problem is related to the ansi join syntax or mySQL not knowing what 'distinct' is.


You'll need to upgrade mySQL to 4 or try the following fix:


1) Find the file:




2) Find the line:


$count_query = tep_db_query("select count(" . $count_string . ") as total...


3) Change it to:


$count_query = tep_db_query("select count(" . '*' . ") as total...


You'll have some problems with the count and possibly duplicate results, but it's a quick fix.


Hope this helps!


Justin =)

Link to comment
Share on other sites



Hey Justin!


I just applied your hack and it seems to work just fine, at least for now.


I'm hoping my ISP can upgrade it's version of mySQL sometime soon and I can go back to the original code.


Thanks again for the workaround!

Link to comment
Share on other sites


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

  • Create New...