Hi,
OLBG - that would be fine, but I want to display a date even if there is no data corresponidng to that date in the DB.
The way I have gone about it is to get the number of days in the month - in PHP this is:
date("t")
Then I have looped around every day in the month and within the loop fire a select to get the data (if any) from MySQL.
If no data is returned, make the data/figure a '0', then display the date and '0' data, otherwise display the data and the database value.
It works perfectly, and fast.
But, the only downside I see is firing off 28-30 selects (1 for each day of the month) .
I'd love to know if there is an easier way but with only using 1 SQL query.
Daniel
|