Re: problem with next-button
| From: | bettina pfeifer | Date: | Sat, 12 Apr 2003 15:19:55 +0000 |
| Subject: | Re: problem with next-button | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-27038@lists.php.net to get a copy of this message | ||
still wondering why nobody could give me a hint on my problem, i found out, that my local installation of php is newer than my providers and
register_globals=On
helped me. knowing that it is not the fine style, but could not find the good style yet.
so long, bettina
bettina.pfeifer@softfabrik.de wrote:
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>"; }