所以我试图提前 24 小时以上返回所有约会。我很肯定代码中的错误是围绕 DATE_ADD 的东西,所以我知道 PHP 变量设置正确。我想我只是在想 DATE_ADD 错误。我还尝试了几种括号变体,但都没有运气。只是 CURDATE() 有效。谢谢你的帮助!
$sql = " SELECT DISTINCT timeBlocks.date
FROM timeBlocks
WHERE timeBlocks.location = '".$appointmentLocation."' AND timeBlocks.school = '".$_SESSION["school"]."' AND timeBlocks.date >= DATE_ADD(curdate(), INTERVAL 1 YEAR)
ORDER BY timeBlocks.date ASC;";