Just wondering if anyone had had a problem with the code from chapter 16 for index.php?
I've downloaded the code from the site and tried to run it and I get the following error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mod FROM forum_forum f LEFT JOIN forum_posts p ON f.id = p.forum_id AND p.topic_' at line 1
The error comes from this code:
$sql = "SELECT f.id as id, f.forum_name as forum, f.forum_desc as description, count(forum_id) as threads, u.name as mod FROM forum_forum f LEFT JOIN forum_posts p ON f.id = p.forum_id AND p.topic_id=0 LEFT JOIN forum_users u ON f.forum_moderator = u.id GROUP BY f.id";
$result = mysql_query($sql) or die(mysql_error());
now this is as per the book, so I'm wondering if this is a config problem... anyone else experienced it or know what it is?