Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 13th, 2005, 09:59 AM
Registered User
 
Join Date: Apr 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 15 Code Error - HELP!

Hey everyone,

I have downloaded the code for the message board in chapter 15, however, after I have created all the database tables, I receieve the following error from the main index page:

'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'

Anybody have any ideas?

Cheers!

Reply With Quote
  #2 (permalink)  
Old April 15th, 2005, 06:01 PM
Registered User
 
Join Date: Apr 2005
Location: , , United Kingdom.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have exactly the same problem, someone please help us.....
Reply With Quote
  #3 (permalink)  
Old April 25th, 2005, 04:42 PM
Registered User
 
Join Date: Apr 2005
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yer you guys me 2. Not a clue on it really.

Reply With Quote
  #4 (permalink)  
Old October 18th, 2007, 08:52 PM
dba dba is offline
Registered User
 
Join Date: Feb 2005
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Why is this still a problem with no solution. I am having same problem!

Chapter 15. sql that causes error
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

Error is listed here:
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.i' at line 2

On of you geniuses that took our money want to provide a fix???



Reply With Quote
  #5 (permalink)  
Old January 24th, 2008, 05:13 PM
Registered User
 
Join Date: Jan 2008
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am having the same problem and can't find a solution already listed in this forum. Any help out there?

Reply With Quote
  #6 (permalink)  
Old January 24th, 2008, 05:33 PM
Registered User
 
Join Date: Jan 2008
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

OK.. I figured it out.

The problem is with the 'u.name as mod' portion of the SELECT statement in index.php. The word 'mod' is a reserved word in MySQL 5.0.

To fix this problem, change the 'u.name as mod' to 'u.name as moderator'.

You will then need to change the code later in the file which accesses this field.

Change
     echo "<td class='center'>" . $row['mod'] . "</td>";
to
    echo "<td class='center'>" . $row['moderator'] . "</td>";

It seems to work correctly after this....

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
error while debugging in chapter 15 great.early805 BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 1 April 12th, 2008 02:27 AM
code chapter 14 & 15 pierrethienpont BOOK: Professional VB 2005 ISBN: 0-7645-7536-8 1 February 24th, 2007 03:26 PM
code source for the chapter 15 springDavid BOOK: Professional Java Development with the Spring Framework 3 April 19th, 2006 03:02 PM
Chapter 15 - Code doesn't run marcohp BOOK: Beginning XML 3rd Edition 0 November 8th, 2005 03:41 PM



All times are GMT -4. The time now is 01:09 PM.


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