problem with next-button
| From: | bettina.pfeifer@softfabrik.de | Date: | Fri, 11 Apr 2003 09:26:59 +0000 |
| Subject: | problem with next-button | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-27012@lists.php.net to get a copy of this message | ||
hello,
can you please help me with the following behavior:
my php-code displays the first 5 records and creates a button to display the next 5.
only, when clicking this next-button, nothing happens. the value ist not really used to display the following records. many things i tried, nothing helped. it is the same code i used in another webpage that is well running as it should do.
the button source code is: <a href="test_debug.php?anfang=5">.. </a>
(the resulting file is valid html 4.01)
thank you!
bettina
any suggestions? my code is as follows:
<?php
$anfang = (isset($anfang)) ? abs((int)$anfang) : 0; //$anfang means startvalue
$limit = 5; // Datensätze pro Ausgabeseite// Feststellen der Anzahl der verfügbaren Datensätze. $resultID = @mysql_query("SELECT COUNT(zID) FROM tabdiary");
$total = @mysql_result($resultID,0);
$anfang = ($anfang >= $total) ? $total - $limit : $anfang;// Datenbankabfrage ausführen.
$query = "SELECT a, b, c, dFROM tabdiary order by dDatum LIMIT ".$anfang.", ".$limit; echo $query; echo "<br>"; $result = mysql_query($query); echo $anfang." bis ".$limit." von ".$total." auf ".$_SERVER['PHP_SELF']."."; if ($result) { ... display table with records.... } // buttons if ($anfang > 0) { $newStart = ($anfang - $limit < 0) ? 0 : ($anfang-$limit); echo "<a href=\"/test_debug.php?anfang=$newStart\"><b><<< zurück</b></a> ";} if ($anfang + $limit < $total) { $newStart = $anfang + $limit; echo $newStart."<br>"; // echo " <a href=".$_SERVER['PHP_SELF']."?anfang=".$newStart."><b>weiter >>></b></a>"; echo " <a href=\"/test_debug.php?anfang=$newStart\"><b>weiter >>></b></a>"; }