I'm currently working on the very last aspect of my project and am looking to build a matching function that is dynamic. Once I get this query to work I will have it solved, problem is its returning the wrong values
SELECT `Advert_ID`, `User_ID`, `Username` FROM adverts
WHERE ( `Skill_Proffession_Needed` LIKE 'Plumbing'
AND `Skill_Area_Needed` LIKE 'Ceptic'
AND `Skill_Level_Needed` LIKE 'Proffessional')
OR (`Skill_Proffession_Needed` LIKE 'Plumbing'
AND `Skill_Area_Needed` LIKE 'Heating'
AND `Skill_Level_Needed` LIKE 'Proffessional')
OR (`Skill_Proffession_Needed` LIKE 'Plumbing'
AND `Skill_Area_Needed` LIKE 'Sink'
AND `Skill_Level_Needed` LIKE 'Proffessional')
AND `User_ID` = '16'
AND `Location_Country` LIKE 'Ireland'
AND `Location_City` LIKE 'Dublin' AND Active = 1
Problem is it seems to be ignoring the last 4 AND statements and returning Inactive Adverts and Adverts not in that location. I have tried rearranging the last 4 AND statements and placing them at the top, and still the same error. I also have tried adding extra brackets into the OR queries to prioritize and still had the same issue.
Any help at all would be very helpful