MyBB Community Forums

Full Version: Users cannot log in.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
www.rookgaard.pl/forum

Everytime when someone wants to log in there is a problem.

Quote:MyBB SQL Error

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1054 - Unknown column 'loginattempts' in 'field list'
Query:
SELECT loginattempts FROM mybb_users WHERE LOWER(username)='eldryzif' LIMIT 1

How can I deal with it?

@edit
It happens since I have installed the latest version (1.4.9).
Run then upgrade script and choose 1.4.9 from the list, by the looks of it you didn't follow a previous upgrade process properly.
(2009-09-27, 06:38 PM)MattRogowski Wrote: [ -> ]Run then upgrade script and choose 1.4.9 from the list, by the looks of it you didn't follow a previous upgrade process properly.

I am having the same problem. I definitely followed the upgrade process, and received a successful update message. I just tried again for good measure and again got a successful upgrade message.

Would this be solved by adding the missing field to users table? Is there another solution? Grateful for any help.

Unfortunately the forum is not accessible on the internet.
You shouldn't need to add it manually, that's the point of the upgrade script, there's not really anything that can go wrong with it. Make sure you have the full ./install/ folder and all it's contents, run it, choose 1.4.3.
Humm. 'There's not really anything that can go wrong'. If that is the case then you have written the first bug free upgrade in the history of computing.

The instructions are simple. I followed them. And yet I have this problem.

Unless you have a better idea I will try edit the table myself. I know this is a free product, but I was kinda hoping for a more helpful response.
The upgrade script that deals with this is just a few queries, that removes a column from one place, and adds it to a different place. If you want I'll try it for you but of all the thousands of people that ran this upgrade, pretty much every person who had this problem said either they didn't run it at all, they didn't have all the right files, or they chose the wrong version.

if($db->field_exists('loginattempts', "sessions"))
{
	$db->write_query("ALTER TABLE ".TABLE_PREFIX."sessions DROP loginattempts;");
}

if($db->field_exists('loginattempts', "users"))
{
	$db->write_query("ALTER TABLE ".TABLE_PREFIX."users DROP loginattempts;");
}

if($db->type == "pgsql")
{
	$db->write_query("ALTER TABLE ".TABLE_PREFIX."users ADD loginattempts smallint NOT NULL default '1';");
}
else
{
	$db->write_query("ALTER TABLE ".TABLE_PREFIX."users ADD loginattempts tinyint(2) NOT NULL default '1';");
}

Drops the loginattempts field from the sessions and users if it exists, and then adds it to the users.

Either that or they had a sideboxes plugin, only just remembered that broke too.