Filtering log file using COUNT, GROUP BY, ORDER BY MAX
问题 Hi I have a machine that logs where guests and users navigate to and I'm trying to write a php script that will sort the logs and summarize for me the top five destinations people tend to go to i.e. what pages are visited the most. So far this is what I have: <?php #### mysql connection ##### $db = mysql_connect("_","guest","_"); mysql_select_db(networkr) or die("Couldn't select the database"); echo "<table>"; $query = "SELECT uri LIMIT 5, COUNT(date) GROUP BY uri ORDER BY MAX(COUNT(date)),