I am making a site to do simple stats for a local sports league. I am having trouble with the following query:
SELECT sr.event, p.name, p.school, sum(sr.win) won, count(*) played
FROM singlesResults sr, players p
WHERE p.ID = sr.playerID
GROUP BY event, p.name, p.school
ORDER BY event, won DESC, p.name;
When run from the msyql> command line, this query returns 63 rows and takes .02 seconds. However when run in my PHP script (ie. $result = mysql_query($strQuery,$db)😉, it takes LITERALLY 5-10 MINUTES to return the result.
Most queries take about 1 second to display in my browser, but this and a couple like it take forever.
Any suggestions? Thanks in advance 🙂
Rob