hi, everybody!
1. i have mysql data with several rows.
2. i want to print/display data by "x rows/page."
3. i tried to do it with the following script:
function navDat ($ThisScript = " ", $StartingPage = 0, $Thistbl)
{
global $PHP_SELF;
if (empty ($ThisScript))
{
$ThisScript = $PHP_SELF;
}
if (empty ($StartingPage))
{
$StartingPage = 0;
}
PAGE_LIMIT = 2;
$xEntriestoPrint = PAGE_LIMIT;
$Thistbl; // Undefined. Value to be supplied in the function call.
$ThisResult = mysql_query ("select count(*) from $Thistbl");
list ($xRows) = mysql_fetch_array ($ThisResult);
print "<p>\n";
if ($StartingPage > 0)
{
print "<a href=\"$ThisScript?StartingPage=".($StartingPage - $xEntriestoPrint)."\"><<Previous Entries</a> ";
}
if (($StartingPage + $xEntriestoPrint) < $xRows)
{
echo " <a href=\"" . $PHP_SELF . "?StartingPage=" . ($StartingPage + $xEntriestoPrint) . "\">Next Entries>></a>";
}
print "</p>\n";
}
4. from a script that prints mysql data by two, i call the above with:
$Thistbl = ThisDataSource;
navDat ($ThisScript, $StartingPage, $Thistbl);
5. THE PROBLEM: while the "previous" and "next" links are being printed, the content of the page remains the same? only the first two entries of the mysql data/table are being printed, instead of the script printing rows 0-1, 2-3, 4-5 ...