arunavak111

Untitled

Feb 21st, 2014
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.00 KB | None | 0 0
  1. $content_article = array();
  2.     $query = db_query("SELECT *, max( hit_count ) AS ht FROM `tnf_track_click` WHERE article_type = 'News' AND last_clicktime >= ( %s ) GROUP BY article_title ORDER BY ht DESC", (time()-86400));
  3.     while ($records = db_fetch_array($query)) {
  4.         foreach ( $records as $key => $value ) {
  5.             $temp[$records['ht']][$key] = $value;
  6.             $content_article = $content_article+$temp;
  7.         }
  8.     }echo 'Count1 : '.count($content_article).'<br>';
  9.     $query = db_query("SELECT *, count(*) as ht FROM `tnf_node_view_count` where last_clicktime >= ( %s ) group by node_id order by ht DESC", (time()-86400));
  10.     while ($records = db_fetch_array($query)) {
  11.         foreach ( $records as $key => $value ) {
  12.             $temp[$records['ht']][$key] = $value;
  13.             $content_article = $content_article+$temp;
  14.         }
  15.     }echo 'Count2 : '.count($content_article).'<br>';
  16.     // Sort array on the basis of hit count.
  17.     $content_article= krsort($content_article);
Advertisement
Add Comment
Please, Sign In to add comment