Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6
This is the forum to discuss the Wrox book Beginning PHP, Apache, MySQLWeb Development by Michael K. Glass, Yann Le Scouarnec, Elizabeth Naramore, Gary Mailer, Jeremy Stolz, Jason Gerner; ISBN: 9780764557446
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 11th, 2007, 11:21 AM
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

 
Old November 20th, 2007, 10:49 PM
Registered User
 
Join Date: Nov 2007
Location: , , Australia.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hey all.

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

 
Old March 10th, 2008, 02:52 PM
Registered User
 
Join Date: Jan 2008
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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'





Similar Threads
Thread Thread Starter Forum Replies Last Post
Bulletin Board system smith Wang BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 1 November 11th, 2007 08:12 PM
Adding Categories to Message board in Ch.16 PlaGuE BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 November 19th, 2005 08:24 PM
bulletin board in the book not correct yatishjain BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 February 12th, 2005 10:31 AM
creating a bulletin board system djfranknitti Beginning PHP 1 October 27th, 2004 08:00 AM
bulletin board allang Classic ASP Databases 2 May 24th, 2004 07:40 AM





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