i had the same problem,
the problem is that the $offset variable does not get initialised until you define it in the url (localhost/page.php?offset=n).
When you just go to localhost/page.php
the mysql query will look like this:
"SELECT movie_name, movie_year " .
"FROM movie " .
"ORDER BY movie_name " .
"LIMIT ,1"
whilst mysql expects a "LIMIT n,x"
So you have to set a value for offset ONLY when it has no value yet.
As this is not yet explained at that point, this is the answer:
Instead of
Code:
$offset = $_REQUEST['offset']
you have to do this
Code:
//make sure a value is assigned to $offset if it not yet exists.
if ($_REQUEST['offset'] == NULL
{
$offset=0;
}
else
{
$offset=$_REQUEST['offset'];
}
//just to double check
echo $offset;