Dit krijgt alle records waar atn_date
is in deze maand:
SELECT * FROM `tbl_atn` WHERE `atn_date` BETWEEN "2012-06-01" AND "2012-06-30"
Deze PHP loopt deze maand elke dag door:
$thisTime = strtotime("2012-06-01");
$endTime = strtotime("2012-06-31");
while($thisTime <= $endTime)
{
$thisDate = date('Y-m-d', $thisTime);
echo $thisDate;
$thisTime = strtotime('+1 day', $thisTime); // increment for loop
}