I'm new to PHP and I'm trying to select records (for search functionality) in my table where the month is static and other columns vary.
Below is the query:
SELECT *
FROM issue
WHERE month = "Apr 2019"
AND issue LIKE "%ekh%"
OR issue_type LIKE "%ekh%"
OR facility LIKE "%ekh%"
OR issue_id LIKE "%ekh%"
OR priority LIKE "%ekh%"
ORDER BY issue_id DESC
This is rather returning all rows that satisfy the like clauses, even when month isnt = "Apr 2019".
likestatements inside parentheses, so you havemonth="XX" and (issues like "XX" etc).