I am having trouble selecting rows in MySQL. I do not want some rows to be selected, but they are being selected.
SELECT name,url FROM additions WHERE enabled = 1 AND picture = 1 AND name LIKE '%value%' OR tags LIKE '%value%' OR subtext LIKE '%value%';
I do not want the rows that do not have a picture (
picture = 0) and also rows that are not enabled (
enabled = 0) to be selected. I think the rows match because either the name, tags and/or subtext matches the
value, because of the
OR condition in WHERE clause.
I want only the rows to be selected that have a picture and are enabled, regardless of the match in name, tags, subtext. How can I achieve that?