problem with next-button

From: 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, d
FROM 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>&lt;&lt;&lt; zur&uuml;ck</b></a>&nbsp;&nbsp;";} if ($anfang + $limit < $total) { $newStart = $anfang + $limit; echo $newStart."<br>"; // echo " &nbsp;&nbsp; <a href=".$_SERVER['PHP_SELF']."?anfang=".$newStart."><b>weiter &gt;&gt;&gt;</b></a>"; echo "&nbsp;&nbsp; <a href=\"/test_debug.php?anfang=$newStart\"><b>weiter &gt;&gt;&gt;</b></a>"; }

« previous php.db (#27012) next »