I am getting an error "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '0RDER BY movie_name' at line 4". I am using PHP version 5.2.8 , MySQL version 5.0.51a and Apache
I have attached the code here
<?php
$host = 'localhost';
$user = 'myhost';
$pass = 'password';
$handle = mysql_connect($host, $user, $pass)
or die("Could not connected to MySQL check your username and password.\r\n");
//make sure we are using the right database
mysql_select_db("moviesite")
or die("The Database you have selected does not exist");
//get our starting point for the query through the URL variable "offset"
$offset = $_REQUEST['offset'];
$query = "SELECT movie_name, movie_year
FROM movie
ORDER BY movie_name
LIMIT $offset,1";
$results = mysql_query($query)
or die(mysql_error());
echo "<table>\n";
while ($rows=mysql_fetch_assoc($results)) {
echo "<tr>\n";
foreach($rows as $value) {
echo "<td>\n";
echo $value;
echo "</td>\n";
}
echo "</tr><br>\n";
}
echo "</table>\n";
echo "<a href='page.php?offset=0'>Page 1</a><br>";
echo "<a href='page.php?offset=1'>Page 2</a><br>";
echo "<a href='page.php?offset=2'>Page 3</a><br>";
?>
.