Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Using ' in search causes SQL error


sabotage79

Recommended Posts

Posted

I just noticed this problem, if someone types in eagle's, or such, I get this error:

 

1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 's%' and pd.products_name like '%head%' ) OR ( p.products_mode



select count(*) 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 '%eagle's%' and pd.products_name like '%head%' ) OR ( p.products_model like '%eagle's%' and p.products_model like '%head%' ) OR ( m.manufacturers_name like '%eagle's%' and m.manufacturers_name like '%head%' ) OR ( pd.products_description like '%eagle's%' and pd.products_description like '%head%' ) )

 

Can someone tell me how to ignore the '?

Archived

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

×
×
  • Create New...