Jump to content

Recommended Posts

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

  • 2 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.