includes/stats.php
changeset 1012 d966be8d79a3
parent 953 323c4cd1aa37
child 1081 745200a9cc2a
equal deleted inserted replaced
1011:96119a79cf81 1012:d966be8d79a3
    61   }
    61   }
    62   
    62   
    63   $data = array();
    63   $data = array();
    64   $q = $db->sql_query('SELECT COUNT(hit_id) AS num_hits, page_id, namespace FROM '.table_prefix.'hits GROUP BY page_id, namespace ORDER BY num_hits DESC LIMIT ' . $num . ';');
    64   $q = $db->sql_query('SELECT COUNT(hit_id) AS num_hits, page_id, namespace FROM '.table_prefix.'hits GROUP BY page_id, namespace ORDER BY num_hits DESC LIMIT ' . $num . ';');
    65   
    65   
    66   while ( $row = $db->fetchrow() )
    66   while ( $row = $db->fetchrow($q) )
    67   {
    67   {
    68     $title = get_page_title_ns($row['page_id'], $row['namespace']);
    68     $title = get_page_title_ns($row['page_id'], $row['namespace']);
    69     $data[] = array(
    69     $data[] = array(
    70         'page_urlname' => $paths->get_pathskey($row['page_id'], $row['namespace']),
    70         'page_urlname' => $paths->get_pathskey($row['page_id'], $row['namespace']),
    71         'page_title' => $title,
    71         'page_title' => $title,