Hello All:

I tried looking for several reporting tools for PHP however I was not happy with what i found and figured that straight PHP combined with some basic css will allow me to make all the reports i need, without having to work around the reporting frameworks own quirks and limitations.

I need to create very simple reports like this:

Group 1
Record 1

Record 2
...n
Group 1 Total
Group 2
Record 1

Record 2
...n
Group 2 Total

Total for Report Group 1 + Group 2

Does anyone have any recommendations on how to do this. Using the Group By clause in mysql will give me the group totals but not list the individual records within the groups or give me the Report Total.

Is there a straightforward way to do this or should I write php code to loop through my records and sort them and then create the necessary totals and subtotals?

Thanks in advanceπŸ™‚

    Instead of using GROUP BY, use ORDER BY. This way, all the records for each group would be lumped together, so it becomes a matter of including some logic to determine when the list of records for one group ends and the next group begins.

      Thanks Laser, so basically I order the result set coming from mysql and run php code to create the group summaries and the total summaries...

      Appreciate it!πŸ™‚

        Write a Reply...