Hmm this here seems as though it should work perfectly but it also returns an error that it cant run the query.
$query = "SELECT intEventID,vchEventTitle,date_format(dtmStartDate,'%m-%d')";
$query .= "AS 'StartDate',date_format(dtmEndDate,'%m-%d') AS EndDate FROM $event_table";
$query .= "WHERE dtmStartDate > NOW() AND (TO_DAYS(dtmStartDate)) < (TO_DAYS(NOW()) + 31)";
$query .= "ORDER BY dtmStartDate";
$result = mysql_query($query2) or die("Unable To Run Query");
The TO_DAYS function turns the current date into the number of days since year 0.
So my SQL is saying select these rows where the date is > Today and the number of days between the startdate and NOW is < 31.
It should atleast run right? At the very least it should just return 0 rows but instead it is erroring out and saying it cant even run the query... hmmm
any ideas? Thanks!
😃