|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-04-23 07:07 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 19 16:00:01 2025 UTC |
Description: ------------ Hi.this is mahesh. i worte a scrit for retriving records with next,previous buttons and pagenumbers.But when i press next or pagenumbers like 1,2 that will not display next regarding records.i have 30 records and i displaying initially 10 records.next 10 records are not displaying when i press next.please help me. Reproduce code: --------------- if (!isset($screen)) $screen = 0; $start = $screen * $rows_per_page; $sql = "SELECT name FROM student_adv "; $sql .= "LIMIT $start, $rows_per_page"; $result = mysql_query($sql) or die(mysql_error()); $rows = mysql_num_rows($result); //echo $rows; for ($i = 0; $i < $rows; $i++) { $description = mysql_result($result, $i, 0); echo "$description<br>\n"; } echo "<p><hr></p>\n"; // let's create the dynamic links now if ($screen > 0) { $url = "search1.php?screen=" . $screen - 1; echo "<a href=\"$url\">Previous</a>\n"; } // page numbering links now for ($i = 0; $i < $pages; $i++) { $url = "search1.php?screen=" . $i; echo " | <a href=\"$url\">$i</a> | "; } if ($screen < $pages) { $url = "search1.php?screen=" . $screen + 1; echo "<a href=\"$url\">Next</a>\n"; } Expected result: ---------------- show next 10 records when i press next link. Actual result: -------------- The requested URL /mahesh/1 was not found on this server.