ok I want to display forward and backward buttons when I get the data from a database, here is the code, but it says unexpected T_variable...
<?
$username="x";
$password="y";
$database="x";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
if(!isset($start)) $start = 0;
$query = "SELECT FROM news LIMIT " . $start . ", 10";
//do database connection
$result = mysql_query($query); //you should do error checking
//display data
//this code was wrong, I did not have the second query. Thanks to Plaggy Pig.
// need another query to get the total amount of rows in our table
$query = "SELECT count() as count FROM table";
$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";
?>