I'd been trying to do date range comparisons all day, and found that using sql was the only way to find out if a date (inside a table) was between a range (assigned by me)
I have 4 of the statements below, one for each season.
$strSQL = 'SELECT * '
. ' FROM `calendar` '
. ' WHERE `eventdate` '
. ' BETWEEN "2008-04-30" AND "2008-06-23"'
. ' ORDER BY `eventdate` ASC';
The problem i'm having now, is that i need to assign a season to each date range to use in my document as a variable ( $quarter
). What i figured i'd need to do was see if the current date was within that range, so i'd need to get the system date. Not sure how to achieve this in sql and pass the variable through to use in the document.
<a href="" onclick="return showPanel(this, 'fall');" <?php if($quarter == "fall"){ echo("class='active'"); }?> >FALL</a>
Any help would be appreciated, i'm tearing my hair out over this.