p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 (http://p2p.wrox.com/forumdisplay.php?f=123)
-   -   Ch 16 Bulletin Board Code Problem (http://p2p.wrox.com/showthread.php?t=63677)

bigkevracer November 11th, 2007 11:21 AM

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


bigkevracer November 20th, 2007 10:49 PM

hey all.

still waiting for a response on this from the publishers, but anyone else solved this problem?


ryoga_7482 March 10th, 2008 02:52 PM

http://p2p.wrox.com/topic.asp?TOPIC_ID=29227

mod is reserved - change to a different alias, be sure to check other references to 'mod'



All times are GMT -4. The time now is 08:13 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.