troubleshooting Question

Mysql Use two AND's to retrieve only records matching both

Avatar of Tony Pearce
Tony PearceFlag for United Kingdom of Great Britain and Northern Ireland asked on
5 Comments3 Solutions262 ViewsLast Modified:
I have a query that looks for matching criteria in two columns, when using this query either/or gets selected, I need it to only pick the records that match both??

SELECT ProdCAT1 FROM $tableName WHERE ProdCAT1 LIKE '%$siteword%' AND ProdSELECT LIKE '%$brandword%'

Any pointers? I can't use PHP, it must be done in the query...
Join our community to see this answer!
Unlock 3 Answers and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros