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 July 20th, 2004, 08:32 AM
Authorized User
 
Join Date: Jul 2004
Location: , , .
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 15 problem

On trying to load any of the forums created (viewforum.php) I get this error message:

You have an error in your SQL syntax near '.id as topic_id, t.subject as t_subject, u.name as t_author, count(p.id) as numr' at line 1
SELECT SQL_CALC_FOUND_ROWS t.id as topic_id, t.subject as t_subject, u.name as t_author, count(p.id) as numreplies, t.date_posted as t_posted, tmp.postdate as re_posted FROM forum_users u JOIN forum_posts t ON t.author_id = u.id LEFT JOIN tmp ON t.id = tmp.topic_id LEFT JOIN forum_posts p ON p.topic_id = t.id WHERE t.forum_id = 2 AND t.topic_id = 0 GROUP BY t.id ORDER BY re_posted DESC LIMIT 0, 10

I've looked through all the other postings, and I've seen no reference to this problem. This make me think that it is something that I've done wrong!

Please, can anyone can give me a pointer as to what's gone wrong?
Reply With Quote
  #2 (permalink)  
Old July 24th, 2004, 07:44 AM
Authorized User
 
Join Date: Jul 2004
Location: , , .
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Me again!
I've re-uploaded the original files (the ones unchanged by myself and the ones downloaded from the source code) to the server, and I am getting exactly the same error!
Therefore, it isn't anything that I've done!
PS. It is the same error whether I have changed all the known bugs in the scripts or not!

Why has no one else had this problem?

Reply With Quote
  #3 (permalink)  
Old July 27th, 2004, 08:39 AM
Registered User
 
Join Date: Jul 2004
Location: Sydney, NSW, Australia.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi all,

I'm getting the same error as above:

You have an error in your SQL syntax near 'ON t.author_id = u.id LEFT JOIN tmp ON t.id = tmp.topic_id LEFT JOIN forum_posts' at line 1
SELECT SQL_CALC_FOUND_ROWS t.id as topic_id, t.subject as t_subject, u.name as t_author, count(p.id) as numreplies, t.date_posted as t_posted, tmp.postdate as re_posted FROM forum_users u JOIN forum_posts t ON t.author_id = u.id LEFT JOIN tmp ON t.id = tmp.topic_id LEFT JOIN forum_posts p ON p.topic_id = t.id WHERE t.forum_id = 1 AND t.topic_id = 0 GROUP BY t.id ORDER BY re_posted DESC LIMIT 0, 10

This only happens when clicking on the forum links - anyone have a fix for this?

- Dave
Reply With Quote
  #4 (permalink)  
Old July 27th, 2004, 09:16 AM
Authorized User
 
Join Date: Jun 2004
Location: , , .
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Just FYI, I'll take a look at this evening if I can.

Reply With Quote
  #5 (permalink)  
Old August 2nd, 2004, 07:30 AM
Registered User
 
Join Date: Jul 2004
Location: Sydney, NSW, Australia.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Any updates as to a solution for this?

- Dave

Reply With Quote
  #6 (permalink)  
Old August 6th, 2004, 06:25 AM
Authorized User
 
Join Date: Jul 2004
Location: , , .
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,
If anyone is currently working on this problem could you please place a thread to let us know.

I've now tried everything I know to fix this problem, and I can't work it out!

It definitely seems to be related to SELECT SQL_CALC_FOUND_ROWS, because if I cut it out and repeat a count it kind of works.

I shall look elsewhere if I think no one can help.

Reply With Quote
  #7 (permalink)  
Old August 6th, 2004, 09:36 AM
Friend of Wrox
 
Join Date: Jun 2004
Location: Fairfield, Iowa, USA.
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
Default

In order for it to work properly you need to have MySQL 4.0.0 and up. Could u please check u have the proper version.

Christian

Reply With Quote
  #8 (permalink)  
Old August 7th, 2004, 10:26 AM
Authorized User
 
Join Date: Jul 2004
Location: , , .
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes!
I'm running PHP 4.0
Heres the link to my phpinfo file:
http://www.trebrown.com/phpinfo.php

Reply With Quote
  #9 (permalink)  
Old August 9th, 2004, 10:15 AM
Friend of Wrox
 
Join Date: Jun 2004
Location: Fairfield, Iowa, USA.
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You need MYSQL 4.0.0 and up not PHP 4.0

Christian

Reply With Quote
  #10 (permalink)  
Old August 9th, 2004, 03:40 PM
Authorized User
 
Join Date: Jul 2004
Location: , , .
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry!
I got that wrong!
If you were to look at my PHPinfo file you would see that I have PHP 4.1.2

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
chapter 15 problem golfbird BOOK: Beginning Visual C++ 6 7 September 9th, 2008 12:29 PM
chapter 15 checkout3.php problem derrida BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 0 November 12th, 2006 10:11 AM
Chapter 15 Problem rsearing BOOK: Beginning ASP.NET 2.0 and Databases 3 October 12th, 2006 02:59 PM
Chapter 15 Search Problem PhilM BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 2 November 2nd, 2004 05:08 PM
A new chapter 15 problem with BBcodes PhilM BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 2 September 11th, 2004 11:11 PM



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


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