MyBB Community Forums

Full Version: Strange Error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, everyone.
I've been working on a myBB forum for quite some time now, without any errors...until today.

I clicked a forum under a category, and it displayed this error:

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1054 - Unknown column 't.prefix' in 'on clause'
Query:
SELECT t.*, p.displaystyle AS threadprefix, (t.totalratings/t.numratings) AS averagerating, r.uid AS rated, t.username AS threadusername, u.username FROM mybb_threads t LEFT JOIN mybb_users u ON (u.uid = t.uid) LEFT JOIN mybb_threadratings r ON(r.tid=t.tid AND r.uid='2') LEFT JOIN mybb_threadprefixes p ON (p.pid = t.prefix) WHERE t.fid='6' AND (t.visible='1' OR t.visible='0') ORDER BY t.sticky DESC, t.lastpost desc LIMIT 0, 20

Anybody know why this is happening?
http://community.mybb.com/thread-75028.html

The upgrade script hasn't been run.
Completely stupid question here, but how do I run the upgrade script?
yoursite.com/install/upgrade.php, choose your old version from the list, run through the wizard.

This is all explained in the Documentation that comes with MyBB, the Wiki ([Wiki: Upgrading] (Broken link, head over to docs.mybb.com instead)), and the 1.6 release announcement blog post explains that this needs to be run.
Ah, I see. It's located in the install folder.
Thanks, for your help. I appreciate it.

EDIT:I actually removed the "install" folder because I never upgraded from an older version of myBB. I just downloaded 1.6 and installed it.
I'm just bumping this up since I edited my post, and nobody must've noticed it.
Follow the instructions matt gave you in the WIKI, you have to upload, and overwrite all (1.4) files with new (1.6) files then go to the upgrade script.
There's no way you can be getting this if this was a fresh 1.6 install, the column would be there.
It was a fresh 1.6 install, and I accidentally deleted my install folder so I can't access upgrade.php.

EDIT: Actually, sorry about all of this. I found the install folder. It was renamed.
I renamed it back to install, ran upgrade.php, and then renamed it back.
Just download 1.6 again and upload it again; don't do this just yet though, if this really was a fresh 1.6 install I want to find out how you've managed to do this.

I don't know what you downloaded to begin with because this definitely gets added with fresh installs, otherwise we'd have hundreds of support requests about it, and every 1.6 forum I've installed has had it there. This is in the installation code:

$tables[] = "CREATE TABLE mybb_threads (
  tid int unsigned NOT NULL auto_increment,
  fid smallint unsigned NOT NULL default '0',
  subject varchar(120) NOT NULL default '',
  prefix smallint unsigned NOT NULL default '0',
  icon smallint unsigned NOT NULL default '0',
  poll int unsigned NOT NULL default '0',
  uid int unsigned NOT NULL default '0',
  username varchar(80) NOT NULL default '',
  dateline bigint(30) NOT NULL default '0',
  firstpost int unsigned NOT NULL default '0',
  lastpost bigint(30) NOT NULL default '0',
  lastposter varchar(120) NOT NULL default '',
  lastposteruid int unsigned NOT NULL default '0',
  views int(100) NOT NULL default '0',
  replies int(100) NOT NULL default '0',
  closed varchar(30) NOT NULL default '',
  sticky int(1) NOT NULL default '0',
  numratings smallint unsigned NOT NULL default '0',
  totalratings smallint unsigned NOT NULL default '0',
  notes text NOT NULL,
  visible int(1) NOT NULL default '0',
  unapprovedposts int(10) unsigned NOT NULL default '0',
  attachmentcount int(10) unsigned NOT NULL default '0',
  deletetime int(10) unsigned NOT NULL default '0',
  KEY fid (fid, visible, sticky),
  KEY dateline (dateline),
  KEY lastpost (lastpost, fid),
  KEY firstpost (firstpost),
  KEY uid (uid),
  PRIMARY KEY (tid)
) TYPE=MyISAM;";

It's not going to create the table and miss just that one column.

Only other thing is if you installed a plugin for thread prefixes on 1.6, and then removed it??

Do you have a mybb_delayedmoderation and mybb_threadprefixes table??