Page 1 of 1

Did my host upgrade PHP or mySQL?

Posted: Tue May 13, 2008 6:42 pm
by computersOC
I started getting these errors the other day:

Code: Select all

Could not obtain topic information

DEBUG MODE

SQL Error : 1054 Unknown column 't.topic_id' in 'on clause'

SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_time, p.post_username, p3.poster_id AS my_reply_id FROM (phpbb_topics t, phpbb_users u, phpbb_posts p, phpbb_users u2 LEFT JOIN phpbb_posts p3 ON p3.topic_id = t.topic_id AND p3.poster_id = 392) WHERE t.forum_id = 7 AND t.topic_poster = u.user_id AND p.post_id = t.topic_last_post_id AND p.poster_id = u2.user_id AND t.topic_type = 2 GROUP BY p.post_id ORDER BY t.topic_last_post_id DESC

Line : 236
File : viewforum.php

Re: Did my host upgrade PHP or mySQL?

Posted: Tue May 13, 2008 6:56 pm
by RMcGirr83
try this instead

Code: Select all

(phpbb_topics t, phpbb_users u, phpbb_posts p, phpbb_users u2) LEFT JOIN phpbb_posts p3 ON p3.topic_id = t.topic_id AND p3.poster_id = 392
though you clearly have some mod installed that altered that line in viewforum.php so not sure if it will work correctly or not

Re: Did my host upgrade PHP or mySQL?

Posted: Tue May 13, 2008 8:48 pm
by computersOC
Nothing changed on my end, since I haven't made any code changes in awhile.

Since what you gave me has a forum number and user number, I don't know if that will work since it's a different number on each forum when I get the error.

Re: Did my host upgrade PHP or mySQL?

Posted: Tue May 13, 2008 9:16 pm
by T0ny
See if this topic: viewtopic.php?t=840985 is of any use

Re: Did my host upgrade PHP or mySQL?

Posted: Tue May 13, 2008 9:32 pm
by computersOC
I just looked on google and found that... what do I do with:

Code: Select all

FROM (phpbb_topics t, phpbb_users u, phpbb_posts p, phpbb_users u2 LEFT JOIN phpbb_posts p3 ON p3.topic_id = t.topic_id AND p3.poster_id = 2) WHERE
to

Code: Select all

FROM (phpbb_topics t, phpbb_users u, phpbb_posts p, phpbb_users u2) LEFT JOIN phpbb_posts p3 ON p3.topic_id = t.topic_id AND p3.poster_id = 2 WHERE
Thanks for the help!

EDIT: I also get this message when posting, and something similar when searching:

Code: Select all

Error geting users post stat

DEBUG MODE

SQL Error : 1054 Unknown column 'g.group_id' in 'on clause'

SELECT ug.user_id, g.group_id as g_id, u.user_posts, g.group_count, g.group_count_max FROM phpbb_groups g, phpbb_users u LEFT JOIN phpbb_user_group ug ON g.group_id=ug.group_id AND ug.user_id=2 WHERE u.user_id=2 AND g.group_single_user=0 AND g.group_count_enable=1 AND g.group_moderator<>2

Line : 441
File : functions_post.php
Are there any settings I should ask my host to change? Seems it's from mySQL.

Re: Did my host upgrade PHP or mySQL?

Posted: Fri May 16, 2008 2:12 pm
by computersOC
Is this because of something my host did? Should I ask them to change any settings?

Re: Did my host upgrade PHP or mySQL?

Posted: Sat May 17, 2008 12:08 am
by ric323
computersOC wrote:Is this because of something my host did? Should I ask them to change any settings?
They have probably updated to a later version of MySQL, which handles "LEFT JOIN" a bit differently. Adding the parenthesis just before LEFT JOIN makes it work ok on both older and newer versions.

Re: Did my host upgrade PHP or mySQL?

Posted: Sat May 17, 2008 12:21 pm
by computersOC
Do I have to do that on all of the PHP pages, or is there some code I can run in phpMyAdmin that will do something for the database? Thanks.

Re: Did my host upgrade PHP or mySQL?

Posted: Sat May 17, 2008 12:36 pm
by RMcGirr83
You need to change the files that keep tossing the error. Your host has probably updated to mysql 5 which is breaking the sql requests. for your functions_post.php problem, find this

Code: Select all

FROM phpbb_groups g, phpbb_users u
and change it to this

Code: Select all

FROM (phpbb_groups g, phpbb_users u)