I have to create a few functions for a website that will get a lot of data from a MySQL database, process it in a number of ways and produce tables/graphs in HTML and excel format but do not know what the most efficient way of getting, storing and processing the data would be in PHP.
Up till now I’ve just used PHP to submit SQL statements which return rows and then go into objects that I call relevant information from, but the new functions could return up to 18,000 rows which I need to get averages, counts, etc from.
It seems I have to either make a bunch of SQL statements for the counts / averages or use PHP to do something similar. I would need to go through the 18,000 rows up to 20 times. Which would be the preferable way or does anyone have a better idea?
Thanks for any help/advice.
Wherever possible use mysql’s in-built functions for processing data. Normally mysql functions like avg, count are much efficient compared to php