Did my host upgrade PHP or mySQL?

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Locked
computersOC
Registered User
Posts: 2528
Joined: Thu Dec 04, 2003 6:21 am
Location: New York
Contact:

Did my host upgrade PHP or mySQL?

Post by computersOC » Tue May 13, 2008 6:42 pm

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
http://www.computersOC.com - overclocking, P2P, broadband tweaks, ISP forums, more... Computer Building Help -- Overclocking Guide

Want us to install you a phpBB board or update your current one? Want mods/anti-spam mods installed? Moving to a new host? Check us out here.

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: Did my host upgrade PHP or mySQL?

Post by RMcGirr83 » Tue May 13, 2008 6:56 pm

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
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

computersOC
Registered User
Posts: 2528
Joined: Thu Dec 04, 2003 6:21 am
Location: New York
Contact:

Re: Did my host upgrade PHP or mySQL?

Post by computersOC » Tue May 13, 2008 8:48 pm

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.
http://www.computersOC.com - overclocking, P2P, broadband tweaks, ISP forums, more... Computer Building Help -- Overclocking Guide

Want us to install you a phpBB board or update your current one? Want mods/anti-spam mods installed? Moving to a new host? Check us out here.

User avatar
T0ny
Registered User
Posts: 1383
Joined: Sun Jan 29, 2006 8:42 pm
Location: Lancashire
Name: Tony

Re: Did my host upgrade PHP or mySQL?

Post by T0ny » Tue May 13, 2008 9:16 pm

See if this topic: viewtopic.php?t=840985 is of any use

computersOC
Registered User
Posts: 2528
Joined: Thu Dec 04, 2003 6:21 am
Location: New York
Contact:

Re: Did my host upgrade PHP or mySQL?

Post by computersOC » Tue May 13, 2008 9:32 pm

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.
http://www.computersOC.com - overclocking, P2P, broadband tweaks, ISP forums, more... Computer Building Help -- Overclocking Guide

Want us to install you a phpBB board or update your current one? Want mods/anti-spam mods installed? Moving to a new host? Check us out here.

computersOC
Registered User
Posts: 2528
Joined: Thu Dec 04, 2003 6:21 am
Location: New York
Contact:

Re: Did my host upgrade PHP or mySQL?

Post by computersOC » Fri May 16, 2008 2:12 pm

Is this because of something my host did? Should I ask them to change any settings?
http://www.computersOC.com - overclocking, P2P, broadband tweaks, ISP forums, more... Computer Building Help -- Overclocking Guide

Want us to install you a phpBB board or update your current one? Want mods/anti-spam mods installed? Moving to a new host? Check us out here.

User avatar
ric323
Former Team Member
Posts: 22909
Joined: Tue Feb 06, 2007 12:33 am
Location: Melbourne, Australia
Name: Ric
Contact:

Re: Did my host upgrade PHP or mySQL?

Post by ric323 » Sat May 17, 2008 12:08 am

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.
The Knowledge Base contains solutions to many common problems!
How to fix "Doesn't have a default value" and "Incorrect string value: xxx for column 'post_text' " errors.
How to do a clean re-install of the latest phpBB3 version.
Problems with permissions? Read phpBB3 Permissions

computersOC
Registered User
Posts: 2528
Joined: Thu Dec 04, 2003 6:21 am
Location: New York
Contact:

Re: Did my host upgrade PHP or mySQL?

Post by computersOC » Sat May 17, 2008 12:21 pm

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.
http://www.computersOC.com - overclocking, P2P, broadband tweaks, ISP forums, more... Computer Building Help -- Overclocking Guide

Want us to install you a phpBB board or update your current one? Want mods/anti-spam mods installed? Moving to a new host? Check us out here.

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: Did my host upgrade PHP or mySQL?

Post by RMcGirr83 » Sat May 17, 2008 12:36 pm

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)
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

Locked

Return to “2.0.x Support Forum”