How to check if current date falls in holiday date range? I have a table "holidays" with two DATE columns, start_date and end_date. Users can define holidays dates in that range. I need to make a loop that checks is the current date within the holiday date range, and if it is, the current date goes "+1 day", and checks again. I've made it so far:
<?php
include ("config.php");
$curdate = date('Y-m-d', time());
$res = mysql_query("SELECT * FROM holidays WHERE '$curdate' BETWEEN `start_date` and `end_date`");
$resu = mysql_num_rows($res);
if ($resu == NULL)
{
echo "Date is not range";
}
else
{
echo "Date is in range";
}
?>