'' OR youtube_url <> '' AND share_url = '') GROUP BY themes ORDER BY rand() "; $sql1 = " SELECT count1,date,you_image,video_url,youtube_url,owner, title, video_image, update_id, count( count1 ) AS cnt FROM video_updates WHERE (video_url <> '' OR youtube_url <> '' AND share_url = '') GROUP BY themes ORDER BY rand() "; $res = mysql_query($sql) or die(mysql_error()); $sql1.=" LIMIT $start, $limit "; $res1 = mysql_query($sql1) or die(mysql_error()); // mysql_num_rows($res); $reccnt=mysql_num_rows($res); $total_pages=mysql_num_rows($res); $targetpage = $_SERVER['PHP_SELF']; //your file name (the name of this file) if($reccnt>0){ include_once('pagination-new.php'); $i = 0; while($fetch1=mysql_fetch_array($res1)){ //print_r($fetch1); $query=mysql_query("select * from registration where id='".$fetch1['owner']."'"); $fetchuser=mysql_fetch_array($query); ?>