There's an error in the book PAMWeb devpt
In the solution to the exercise where you have to display one movie par page, the solution is impossible because $offset is null the first time.
You have to test:
if ( isset($offset))
$offset = 0;
Funny they left it that way, maybe they want to make sure we're awake during the class:D:):D