This is for an update field and I am checking to be sure the number AND keyword -> OR the campaign name exist to prevent duplicates.
This query is not acting as expected:
$STH = $DBH->prepare("
SELECT *
FROM campaigns
WHERE number = :number AND keyword = :keyword
OR name LIKE :name"
);
I want it to check if (number=number AND keyword=keyword) OR (name=name) - As two different statements not related to eachother. Even if I wrap them in brackets I still get not the right results.
Any help?