Viewforum.php SQL general error after upgrade from 3.0.8 to 3.2 [SOLVED]

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
Post Reply
archibalduk
Registered User
Posts: 48
Joined: Fri Oct 14, 2005 4:21 pm
Contact:

Viewforum.php SQL general error after upgrade from 3.0.8 to 3.2 [SOLVED]

Post by archibalduk »

Support Request Template
What version of phpBB are you using? phpBB 3.2.0
What is your board's URL? http://localhost
Who do you host your board with? Offline server for testing purposes
How did you install your board? I used the download package from phpBB.com
What is the most recent action performed on your board? Update from a previous version of phpBB3
Is registration required to reproduce this issue? No
Do you have any MODs installed? No
Do you have any extensions installed? No
What version of phpBB3 did you update from? phpBB 3.0.8
What styles do you currently have installed? prosilver
What language(s) is your board currently using? British English
Which database type/version are you using? MySQL 5
What is your level of experience? Comfortable with PHP and phpBB
What actions did you take (updating your board; installing a MOD, style or extension; etc.) prior to this problem becoming noticeable? I have a local copy of my forum installed for testing purposes as I am looking into upgrading my forum from v3.0.8 to 3.2. I downloaded the full v3.2 package and used the Update Database Only option. Everything seems to be working fine other than when I try to view a forum and I get the error listed further below.
Please describe your problem. I get the following error when I try to view a forum page (i.e. viewforum.php):

Code: Select all

General Error
SQL ERROR [ mysqli ]

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 'ASC LIMIT 50' at line 4 [1064]

SQL

SELECT t.topic_id FROM (phpbb_topics t) WHERE t.forum_id = 22 AND t.topic_type IN (0, 1) AND 1 = 1 ORDER BY t.topic_type DESC, ASC LIMIT 50

BACKTRACE

FILE: (not given by php)
LINE: (not given by php)
CALL: msg_handler()

FILE: [ROOT]/phpbb/db/driver/driver.php
LINE: 999
CALL: trigger_error()

FILE: [ROOT]/phpbb/db/driver/mysqli.php
LINE: 193
CALL: phpbb\db\driver\driver->sql_error()

FILE: [ROOT]/phpbb/db/driver/mysql_base.php
LINE: 45
CALL: phpbb\db\driver\mysqli->sql_query()

FILE: [ROOT]/phpbb/db/driver/driver.php
LINE: 270
CALL: phpbb\db\driver\mysql_base->_sql_query_limit()

FILE: [ROOT]/phpbb/db/driver/factory.php
LINE: 321
CALL: phpbb\db\driver\driver->sql_query_limit()

FILE: [ROOT]/viewforum.php
LINE: 654
CALL: phpbb\db\driver\factory->sql_query_limit()
Generated by SRT Generator
Last edited by archibalduk on Mon Jun 26, 2017 7:45 pm, edited 1 time in total.
User avatar
david63
Registered User
Posts: 20646
Joined: Thu Dec 19, 2002 8:08 am

Re: Viewforum.php SQL general error after upgrade from 3.0.8 to 3.2

Post by david63 »

Did you remove any MODs that you had installed before you upgraded?
David
Remember: You only know what you know and - you don't know what you don't know!

I now no longer support any of my extensions but they will start to become available here
archibalduk
Registered User
Posts: 48
Joined: Fri Oct 14, 2005 4:21 pm
Contact:

Re: Viewforum.php SQL general error after upgrade from 3.0.8 to 3.2

Post by archibalduk »

No I removed them afterwards. Ought I have done it before upgrading?
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26505
Joined: Fri Aug 29, 2008 9:49 am

Re: Viewforum.php SQL general error after upgrade from 3.0.8 to 3.2

Post by Mick »

  • "The more connected we get the more alone we become" - Kyle Broflovski©
  • "The good news is hell is just the product of a morbid human imagination.
    The bad news is, whatever humans can imagine, they can usually create.
    " - Harmony Cobel
archibalduk
Registered User
Posts: 48
Joined: Fri Oct 14, 2005 4:21 pm
Contact:

Re: Viewforum.php SQL general error after upgrade from 3.0.8 to 3.2

Post by archibalduk »

Thanks - I somehow overlooked that step when running through the guide.

However, it hasn't solved the problem. I restored my old v3.0.8 DB and used the Support Kit Database Cleaner to clean the database before upgrading to v3.2. But I'm still getting the same issue when viewing a forum (i.e. viewforum.php). Is there anything else I should be trying prior to upgrading?

Code: Select all

General Error
SQL ERROR [ mysqli ]

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 'ASC LIMIT 50' at line 4 [1064]

SQL

SELECT t.topic_id FROM (phpbb_topics t) WHERE t.forum_id = 23 AND t.topic_type IN (0, 1) AND 1 = 1 ORDER BY t.topic_type DESC, ASC LIMIT 50

BACKTRACE

FILE: (not given by php)
LINE: (not given by php)
CALL: msg_handler()

FILE: [ROOT]/phpbb/db/driver/driver.php
LINE: 999
CALL: trigger_error()

FILE: [ROOT]/phpbb/db/driver/mysqli.php
LINE: 193
CALL: phpbb\db\driver\driver->sql_error()

FILE: [ROOT]/phpbb/db/driver/mysql_base.php
LINE: 45
CALL: phpbb\db\driver\mysqli->sql_query()

FILE: [ROOT]/phpbb/db/driver/driver.php
LINE: 270
CALL: phpbb\db\driver\mysql_base->_sql_query_limit()

FILE: [ROOT]/phpbb/db/driver/factory.php
LINE: 321
CALL: phpbb\db\driver\driver->sql_query_limit()

FILE: [ROOT]/viewforum.php
LINE: 654
CALL: phpbb\db\driver\factory->sql_query_limit()
User avatar
Toxyy
Registered User
Posts: 943
Joined: Mon Oct 24, 2016 3:22 pm
Location: Namek
Contact:

Re: Viewforum.php SQL general error after upgrade from 3.0.8 to 3.2

Post by Toxyy »

Was your 3.0 config using mysql, and you upgraded selecting mysqli?
I am a web developer/administrator, specializing in forums. If you have work you need done or are too lazy to do, pm me!

Some of my extensions:
[3.3][BETA] Post Form Templates || [3.3][BETA] Anonymous Posts || [3.2][3.3][BETA] ACP Merge Child Forums || [3.2][BETA] Sticky Ad || [3.2][DEV] User Delete Topics || [3.3][DEV] Moderate While Searching || [3.3][RC] Short Number Twig Extension
archibalduk
Registered User
Posts: 48
Joined: Fri Oct 14, 2005 4:21 pm
Contact:

Re: Viewforum.php SQL general error after upgrade from 3.0.8 to 3.2

Post by archibalduk »

No - I used mysqli both before and after upgrade.
User avatar
Toxyy
Registered User
Posts: 943
Joined: Mon Oct 24, 2016 3:22 pm
Location: Namek
Contact:

Re: Viewforum.php SQL general error after upgrade from 3.0.8 to 3.2

Post by Toxyy »

What's your board's url?
I am a web developer/administrator, specializing in forums. If you have work you need done or are too lazy to do, pm me!

Some of my extensions:
[3.3][BETA] Post Form Templates || [3.3][BETA] Anonymous Posts || [3.2][3.3][BETA] ACP Merge Child Forums || [3.2][BETA] Sticky Ad || [3.2][DEV] User Delete Topics || [3.3][DEV] Moderate While Searching || [3.3][RC] Short Number Twig Extension
archibalduk
Registered User
Posts: 48
Joined: Fri Oct 14, 2005 4:21 pm
Contact:

Re: Viewforum.php SQL general error after upgrade from 3.0.8 to 3.2

Post by archibalduk »

My live board is: http://www.ehmtheblueline.com/forums/index.php

But note that the above is still version 3.0.8. I'm running my attempts to upgrade using nd offline server on my laptop (only once I've gotten it all working will I try to upgrade my live site).
User avatar
Toxyy
Registered User
Posts: 943
Joined: Mon Oct 24, 2016 3:22 pm
Location: Namek
Contact:

Re: Viewforum.php SQL general error after upgrade from 3.0.8 to 3.2

Post by Toxyy »

Hmm. I usually just install in a subdirectory but to each his own. I've never done it that way so I can't chime in here, but if you're up for it, maybe attempt it on the live server in some subdirectory?

Besides that... Do you have an error_log file?
I am a web developer/administrator, specializing in forums. If you have work you need done or are too lazy to do, pm me!

Some of my extensions:
[3.3][BETA] Post Form Templates || [3.3][BETA] Anonymous Posts || [3.2][3.3][BETA] ACP Merge Child Forums || [3.2][BETA] Sticky Ad || [3.2][DEV] User Delete Topics || [3.3][DEV] Moderate While Searching || [3.3][RC] Short Number Twig Extension
archibalduk
Registered User
Posts: 48
Joined: Fri Oct 14, 2005 4:21 pm
Contact:

Re: Viewforum.php SQL general error after upgrade from 3.0.8 to 3.2

Post by archibalduk »

No error_log I'm afraid.

Thanks for all of your suggestions on this. I think what I might try is to carry out an incremental upgrade (perhaps 3.0.8 - >3.0.14 -> 3.1 -> 3.2). Perhaps that will help narrow down the source of the issue. If that doesn't help, I'll bite the bullet and try online in a sub-directory as you suggest.
User avatar
Toxyy
Registered User
Posts: 943
Joined: Mon Oct 24, 2016 3:22 pm
Location: Namek
Contact:

Re: Viewforum.php SQL general error after upgrade from 3.0.8 to 3.2

Post by Toxyy »

3.0 to 3.2 should work on its own. But go for it.
I am a web developer/administrator, specializing in forums. If you have work you need done or are too lazy to do, pm me!

Some of my extensions:
[3.3][BETA] Post Form Templates || [3.3][BETA] Anonymous Posts || [3.2][3.3][BETA] ACP Merge Child Forums || [3.2][BETA] Sticky Ad || [3.2][DEV] User Delete Topics || [3.3][DEV] Moderate While Searching || [3.3][RC] Short Number Twig Extension
archibalduk
Registered User
Posts: 48
Joined: Fri Oct 14, 2005 4:21 pm
Contact:

Re: Viewforum.php SQL general error after upgrade from 3.0.8 to 3.2

Post by archibalduk »

I managed to find the solution to this. It seems to relate to the users' default topic sort setting. The fix is to run the following SQL query in phpmyadmin:

Code: Select all

update phpbb_users set user_topic_sortby_type='t';
I had a mod on my 3.0.8 forum which allowed extra topic sorting settings (Support Forum Mod IIRC). I guess this caused the issue.

Credit to the following threads which solved the issue for me:

- viewtopic.php?f=46&t=2120308#p12950282
- viewtopic.php?f=466&p=14382066#p14382021
Post Reply

Return to “[3.2.x] Support Forum”