I need a SQL table which contains the dates of whole year.
Is there any mysql query or php code which helps me to generate a SQL table with a row of dates of whole year?
Eg: table1:
date book
01-01-2013
02-01-2013
03-01-2013
04-01-2013
05-01-2013
...
..
...
31-12-2013
Hope you understand my question! :)
Just replace the echo by a mysql(i) query and php will calculate all dates
$Date = new DateTime('2013-01-01 00:00');
$End = new DateTime('2013-12-31 00:00');
while($Date <= $End) {
echo $Date->format('Y-m-d H:i') . "<br/>";
$Date->modify('+1 DAY');
}