php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41170 search script next and previous options not working
Submitted: 2007-04-23 07:01 UTC Modified: 2007-04-23 07:07 UTC
From: vedurupakamahesh at gmail dot com Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 4.4.6 OS: windows xp
Private report: No CVE-ID: None
 [2007-04-23 07:01 UTC] vedurupakamahesh at gmail dot com
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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-04-23 07:07 UTC] derick@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 09:01:33 2024 UTC