MYSQL - Query to check against other table (hard to explain...)
- by Sam
I have a query that gets a list of emails who have subscribed for a newsletter trial which lasts 30 days..
$thirty = time() - 3024000;
SELECT c.email FROM tbl_clients AS c JOIN tbl_clientoptions AS o ON o.client = c.id WHERE o.option = 'newsletter' AND c.datecreated $thirty
What I want to do is do a check in that same query so it also returns clients OVER 30 days old if they have the tbl_clientoptions.option = 'trialoverride' (ie; a row in the client options table with the value "trialoverride")
basic columns are:
TBL_CLIENTS
id,name,email,datecreated
TBL_CLIENTOPTIONS
id,client,option