Forum Moderators: coopster
This is the code that I have so far. I am getting an error on this line of code. '$result = mysql_query($query)or die ("error");'
MyKey is the primary key.
<html>
<head></head>
<body>
<?php
include ("connect.php");
$MyKey=$_GET['MyKey'];
$query = "select * from teletext where category = 'world' limit 1, $MyKey";
$result = mysql_query($query)or die ("error");
echo "<table border = '1' width='65%'>";
echo "<tr><td><b>Page</b></td>";
echo '<td><b>World News</b></td></tr>';
while ($row = mysql_fetch_array($result))
{
echo "<tr><td>".stripslashes($row['page_nos'])."</td>";
echo "<td><b>" . stripslashes($row['headline'])."</b><br>" .stripslashes($row['news'])."</td></tr>";
}
echo "<a href page.php?MyKey=$MyKey+1>Next";
echo "<table border='1' width='40%'>";
echo "<tr><td align='center'><a href='welcome_page.php'>Home</a></td>";
echo "<td align='center'><a href='page.php?MyKey=$MyKey+1'>Next Page</a></td>";
echo "<td align='center'><a href='page.php?MyKey=$MyKey-1'>Previous Page</a></td></td>";
echo "</table>";
echo "</table>";
mysql_close();
?>
</body>
</html>
Any help would be greatfully received.
Many thanks
99naa