Yes I know, sorry about that. The problem is the quote character, for several reasons, it's not a normal single quote but a symbol resembling it. It has got nothing to do wih the SQL, it's more a matter of rendering the code in a HTML page.
You should be alright for 90% once you replace each occurrence of
’
with
'
Beware that the article literally duplicates each table - a different architecture than yours. The article is meant to show you how it's done - it makes no guarantee you can actually use the code.
BTW, a slightly modified version of the article is available here:
http://quest-pipelines.com/newsletter-v6/1005_A.htm
this has got proper quotes. However that one uses CURRENT_USER to fill in the current user. THat should be SESSION_USER (see:
http://www.futhark.ch/mysql/116.html and
http://www.futhark.ch/mysql/123.html for more info on the user issue)