#41170 [NEW]: search script next and previous options not working
| From: | vedurupakamahesh at gmail dot com | Date: | Mon, 23 Apr 2007 07:01:14 +0000 |
| Subject: | #41170 [NEW]: search script next and previous options not working | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-111796@lists.php.net to get a copy of this message | ||
From: vedurupakamahesh at gmail dot com
Operating system: windows xp
PHP version: 4.4.6
PHP Bug Type: Unknown/Other Function
Bug description: search script next and previous options not working
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.
--
Edit bug report at http://bugs.php.net/?id=41170&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41170&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41170&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41170&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=41170&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=41170&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=41170&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=41170&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=41170&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=41170&r=support
Expected behavior: http://bugs.php.net/fix.php?id=41170&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=41170&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=41170&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=41170&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41170&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=41170&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=41170&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=41170&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=41170&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=41170&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=41170&r=mysqlcfg