In my questions table, each post is timestamped (MM-DD-YYYY). Each individual post has a QuestionID, and a response has both a QuestionID and ResponseID. I want to run a php script that will grab all questions (all posts where ResponseID = null) and display how many questions per day.
I’d like it to be avg questions per day since June 1, 2010.
Your help is much appreciated. Thank you!
This gets each day, and the number of questions:
To get the average you need both the count of days, and sum of number of questions… I would probably do this with 2 queries to MySQL and calculate in PHP.
not optimal, but should work..
I made an assumption, that you wouldn’t want to count days where there were no questions.. otherwise it could be simplified to one query using a mysql function to get the number of days since 6/1/2010.