scottybwoy Posted July 7, 2009 Share Posted July 7, 2009 Hi All, I have an Advanced Search Query, but it isn't returning any results. I performed a basic query to ensure that what I was looking for was there and it returned fine. I just need some help as I have trouble understanding the original query : SELECT DISTINCT p.products_model, m.manufacturers_name, p.products_image, m.manufacturers_id, p.products_id, pd.products_name, pd.products_description, 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 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, products_attributes pa 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 ( ( UPPER( pd.products_name ) LIKE '%AGP%' OR UPPER( p.products_model ) LIKE '%AGP%' OR UPPER( m.manufacturers_name ) LIKE '%AGP%' ) ) ORDER BY pd.products_name Simple Query : SELECT * FROM `products_description` WHERE UPPER( products_name ) LIKE '%AGP%' Produces 12 result rows. I put in UPPER so that the search became case insensitive. Is there a better way for that, and can someone help explain the original statement. Thanks Link to comment https://forums.phpfreaks.com/topic/165055-search-query-not-working/ Share on other sites More sharing options...
fenway Posted July 15, 2009 Share Posted July 15, 2009 I'm not sure I follow... and most comparisons are case-insensitive unless you picked a different collation. Link to comment https://forums.phpfreaks.com/topic/165055-search-query-not-working/#findComment-875971 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.