Just working my way through the sitepoint 'php & mysql' ebook but have been stumped by an error i'm getting on a foreach statement.

Relating directly to the book it's Chapter 4......pages 130, 131 (for those who have the 'You Too Can Create Impressive Database Driven Web Sites Using PHP & MySQL!'

Section from my jokes.html.php page, which is being stated as the error:

<?php foreach ($jokes as $joke): ?>
Error is:
Warning: Invalid argument supplied for foreach() in G:\mowes_portable\www\db\jokes.html.php on line 14

I've triple checked it's the same as the book and can't see anything else amiss. Everything else was working prior to this section (connect to DB, encoding to utf-8, etc all as stated I should do).

Any help much appreciated please.