$sql="select products.*, brand_wt.brand_wt, brand_lsc.brand_lsc FROM products, brand_wt, brand_lsc
WHERE brand_lsc.brand_lsc LIKE '$search_text%' AND products.brand_lsc_id=brand_lsc.brand_lsc_id
OR brand_wt.brand_wt LIKE '%$search_text%' AND products.brand_wt=brand_wt.brand_wt_id
OR product_name LIKE '%$search_text%'
group by product_id";
Quick Summary :
brand_wt and brand_lsc are joins from products. Products stores the ID"s of brand_wt and brand_lsc (in case I wrote it incorrectly)
I need to search through products including the field of brands that contain the linked brand names. Then display the product name and the text in the associated field for the product.
So :
Ex. of fields
brand_wt_id= ID=1 brand_wt=soap
brand_lcs_id=ID=1 brand_lcs=liquid
product_name=ivory
brand_wt=1
brand_lcs_id=1
Final Display after search for "SOAP" through table products
product_name=ivory
brand_wt=soap
brand_lcs_id=liquid
I know this is long. But figured to much info is better then to little. Thanks for any help yo can give. By the way, this works, but I need to group all the information so as not to show redundancies. And the searches take about two seconds.
WHERE brand_lsc.brand_lsc LIKE '$search_text%' AND products.brand_lsc_id=brand_lsc.brand_lsc_id
OR brand_wt.brand_wt LIKE '%$search_text%' AND products.brand_wt=brand_wt.brand_wt_id
OR product_name LIKE '%$search_text%'
group by product_id";
Quick Summary :
brand_wt and brand_lsc are joins from products. Products stores the ID"s of brand_wt and brand_lsc (in case I wrote it incorrectly)
I need to search through products including the field of brands that contain the linked brand names. Then display the product name and the text in the associated field for the product.
So :
Ex. of fields
brand_wt_id= ID=1 brand_wt=soap
brand_lcs_id=ID=1 brand_lcs=liquid
product_name=ivory
brand_wt=1
brand_lcs_id=1
Final Display after search for "SOAP" through table products
product_name=ivory
brand_wt=soap
brand_lcs_id=liquid
I know this is long. But figured to much info is better then to little. Thanks for any help yo can give. By the way, this works, but I need to group all the information so as not to show redundancies. And the searches take about two seconds.