Re: problem with next-button

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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, 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>";
}





--






--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux