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 " .
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:
$offset = $_REQUEST['offset']
you have to do this
//make sure a value is assigned to $offset if it not yet exists.
if ($_REQUEST['offset'] == NULL
//just to double check