$lastpage) { $pageno = $lastpage; } // if $limit = 'LIMIT ' .($pageno - 1) * $rows_per_page .',' .$rows_per_page; $query = mysql_query("select * from files $limit") or die(mysql_error()); $count = 0; while ($sql = mysql_fetch_array($query)){ $name = $sql['name']; $description = $sql['description']; $thumbnail = $sql['thumbnail']; $file = $sql['file']; $id = $sql['id']; $count++; if ($count == 1){ echo '