Sorry but images need to get approved and we do check from time to time but if you think that we're taking too long, do get in touch with a member of the staff and send him a pm asking him to do so.
I can't really see what's wrong. Your error clearly indicates that there's something missing in your foreach() and probably is a variable (jokes) that has no value.
Now, you say that this is a book written by Kevin Yank. He wrote several books but because you're talking about "jokes", I think that this book in particular is "Build your own database driven website with PHP and MySQL"
Chapter 5 is dedicated to the relationships between tables. Could it be the case that the table jokes was completely empty?