if have a mailing script that i’ve set to throttle domains i send to. the remaining domains that do not have a throttle rate set, get assigned a default rate. to find domains which do NOT match an existing throttled domain, i use this php:
$query = "SELECT * FROM `mailer_lists` ml JOIN `mailer_controller` mc";
$query .= " ON ml.project_name = mc.project_name";
$query .= " WHERE `email` NOT LIKE '%";
$query .= "" . implode("' OR '%", $throttle_domain) . "'";
echo "$query";
the output of the echo is:
SELECT * FROM `mailer_lists` ml JOIN `mailer_controller` mc ON ml.project_name = mc.project_name WHERE `email` NOT LIKE '%gmail.com' OR '%hotmail.com' OR '%yahoo.com' OR '%aol.com'
as far as i can tell the output looks perfectly fine. i ran a test query in phpmyadmin and only the first domain applies. anything after the OR is ignored.
is there something obviously wrong with this query that i’m missing? can’t you use multiple OR statements while using the NOT LIKE statement?
I would do
and so on.