MyBB Community Forums

Full Version: When I vists a post allI get is a 1054 SQL error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, I have recently started to get a

SQL Error:1054 - Unknown column 'r.username' in 'order clause'QueryConfusedELECT r.*, u.username, u.usergroup, u.displaygroup FROM mybb_threadsread r LEFT JOIN mybb_users u ON (u.uid = r.uid) WHERE r.tid = '2' AND u.uid != '0' ORDER BY r.username ASC LIMIT 100

SQL error when I open a thread. I can access the forum and sub forum ok but when I go to read a thread I get this error. All the members are seeing this as well. It has been running fine until a few days ago and now this is all I get.

The url to see the exact message is http://www.equineforum.net.au/showthread.php?tid=2

Any help of fixing this problemwould be greatly appreciated.
Have you recently added any updates or plugins?
Do you have any restrictions or changes on your database?

It looks like the join is failing
I added a couple of plugins but that was the first thing I deactivated. A haven't changed anything else to effect the database. I done a fresh install of 1.6.13 when I set up the forum.

Im new to all this so im not sure where to look to fix it. should I back up the database and re install the forum??
Steps:
  1. Try reuploading showthread.php.
  2. Disable all plugins. If this works, then put the setting back to no then manually deactivate them one at a time until there is no longer an error to find which plugin cause it.
  3. Do a search on your files for r.username. Once you find that, where it says ORDER BY r.username change that to ORDER BY u.username
@dragonexpert

I deactivated all plugins and activated one at a time and found that when I was setting up who read thread plugin, I was changing the default sort field to username band this was what caused the error. Since leaving it as the plugin default I haven't had any problems. Thank you for your assistance.