Hi Daniel,
It would make more sense to "fill in the blanks" in your application rather than make 31 separate queries. Logically, they achive the same result anyway.
Use a query to select data for the whole month - along the lines of what OLBG suggests above; and then loop through the result creating a new array that either contains the data from the query for a particular day, or zero if no data exists. Then construct your report from the new array.
If you can post the actual query that you are using at the moment we should be able to help out with some PHP code for the intermediate step...
|