My apologies… I posted some bad code (i.e. code I have been mucking with).
This is the code that I tried first, which I got from the Codewalkers Tutorial…
if(!isset($start)) $start = 0;
$query = "SELECT * FROM test LIMIT " . $start . ", 10";
$result = mysql_query($query);
$query = "SELECT count(*) as count FROM test";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
$numrows = $row['count'];
if($start > 0)
echo "<a href="" . $PHP_SELF . "?start=" . ($start - 10) .
"">Previous</a><BR>n";
if($numrows > ($start + 10))
echo "<a href="" . $PHP_SELF . "?start=" . ($start + 10) .
"">Next</a><BR>n";
I have also tried…
$query = "SELECT * FROM test LIMIT " . $start . ", 10";
$result = mysql_query($query, $db);
$query = "SELECT count(*) as count FROM test";
$result = mysql_query($query, $db);
and…
$result = mysql_query("SELECT * FROM test LIMIT " . $start . ", 10", $db);
$result = mysql_query("SELECT count(*) as count FROM test", $db);
All of these have resulted in the Parse error.