'' OR youtube_url <> '' AND share_url = '') "; $sql1 = "SELECT * from video_updates WHERE (video_url <> '' OR youtube_url <> '' AND share_url = '') "; $res = mysql_query($sql) or die(mysql_error()); $sql1.=" ORDER BY likecounter DESC 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); ?>