kamal213 Posted January 6, 2012 Share Posted January 6, 2012 Hi guys, I am trying to do a multidates events availability calender. The script below indicates todays date by highlighting an orange colour and also indicates the start and end date of the event highlighting grey colour on the two dates (The colour are link via css classes as shown). //Today's date $todaysDate = date("d/m/Y"); $dateToCompare = $daystring . '/' . $monthstring . '/' . $year; echo "<td align='center' "; if($todaysDate == $dateToCompare){ echo "class='today'"; }else{ //Compare's the event dates $sqlcount = "select event_start,event_end from b_calender where event_start ='".$dateToCompare."' AND event_end='".$dateToCompare."'"; $noOfEvent = mysql_num_rows(mysql_query($sqlcount)); if($noOfEvent >= 1){ echo "class='event'"; } } It works ok i.e. if start date = 01/01/2012 and end date = 04/01/2012 both date will be highlighted with grey colour. However I want it to also highlight grey on the dates between the 1st and 4th to show that then anydates between the 1st and 4th are not available and this is when I'm stuck. Please guys I need help. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/254474-php-highlight-dates-between-two-dates-on-calender/ Share on other sites More sharing options...
kamal213 Posted January 6, 2012 Author Share Posted January 6, 2012 It's kool I managed to solve it! figured out it was simply incorpoarating the greater and less than operators in my sql queries. Quote Link to comment https://forums.phpfreaks.com/topic/254474-php-highlight-dates-between-two-dates-on-calender/#findComment-1304814 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.