June 12, 201115 yr 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; this sql query keeps dispalying 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 ' at line 2 any ideas pleases Edited June 12, 201115 yr by lee sands
June 12, 201115 yr Think you're missing a comma, or the 3rd line of your code is incorrect. Are there two tables, or what? Edited June 12, 201115 yr by andyl
June 12, 201115 yr Author nope same error i am using this code from a book to leran php and mysql to delvop applactions
June 12, 201115 yr google is your friend http://www.webdesignerforum.co.uk/topic/8147-any-sql-wizards-out-there-help-with-this/
June 12, 201115 yr MOD is a reserved word.... put `mod` instead and it will work http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html
Create an account or sign in to comment