MySQL will not execute the PHP code you sent it in the query.
That's probably not what you meant to do. Instead, concatenate the result of the date()
call.
$query = "SELECT * FROM contacts WHERE agentassigned = 'agent' AND reminder ='$reminder " . date("Y-m-d",strtotime("+7 day")) . "' ORDER BY firstname";
Based on your comments, you actually want something like this:
SELECT
*
FROM
contacts
WHERE
agentassigned = 'agent'
AND
reminder_date BETWEEN CURRENT_DATE AND CURRENT_DATE + INTERVAL 7 DAY
Where you need to add a column reminder_date
to your table which contains the date of the reminder. You don't want to try to parse it out of a string like you're doing. It's slow and wrong.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…