feri_soft Posted November 4, 2006 Share Posted November 4, 2006 I have a form with many option and i get the variables from those options with $_request.When i try to create a pagination i get the exact number of pages but every page except the first one is totaly empty?Here is what i use:[code]if(!isset($_GET['page'])){ $page = 1; }else{$page = $_GET['page']; } $max_results = 1; $from = (($page * $max_results) - $max_results); $q = mysql_query("some select $whereclause LIMIT $from,$max_results"); if(!$q) die(mysql_error()); $err = mysql_num_rows($q); if($err == 0){ echo("dfgdfg);}while($row = mysql_fetch_array($q, MYSQL_ASSOC)){ sdfsdfsdff} $total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM dfgfdg $whereclause"),0);$total_pages = ceil($total_results/$max_results);for($i = 1; $i <= $total_pages; $i++){if(($page) == $i){ echo "$i ";}else{ echo "<a href='?page=$i'>$i</a> "; } } [/code] Link to comment https://forums.phpfreaks.com/topic/26152-using-pagination-with-post/ Share on other sites More sharing options...
Psycho Posted November 4, 2006 Share Posted November 4, 2006 Well, there are errors in your code, but I don't know if they are causing that problem or not.[code]if($err == 0){ echo("dfgdfg);}[/code]That echo statement is not formatted correctly.[code]sdfsdfsdff[/code]I'm surprised the page even runs with thatI suggest you echo $q to the page to ensure the queries are what you expect them to be. Link to comment https://forums.phpfreaks.com/topic/26152-using-pagination-with-post/#findComment-119590 Share on other sites More sharing options...
feri_soft Posted November 5, 2006 Author Share Posted November 5, 2006 in the original the echo is correvt here i mistake it,but hoever do you see any other errors??? Link to comment https://forums.phpfreaks.com/topic/26152-using-pagination-with-post/#findComment-119893 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.