View Single Post
  #1 (permalink)  
Old November 11th, 2007, 11:21 AM
bigkevracer bigkevracer is offline
Registered User
 
Join Date: Nov 2007
Location: , , Australia.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Ch 16 Bulletin Board Code Problem

Hi everyone.

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:
Code:
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:
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?

Thanks,
Ryan

Reply With Quote