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")
TBL_CLIENTS
table:
- id
- name
- datecreated
TBL_CLIENTOPTIONS
table:
- id
- client
- option