MyBB Community Forums

Full Version: MyBB SQL Error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am asking for help.

I have an error that I cannot solve.

MyBB SQL Error
MyBB has experienced an internal SQL error and cannot continue.
SQL Error:
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'rows FROM mybb_settinggroups WHERE name = 'sceditor'' at line 1
Query:
SELECT COUNT(*) as rows FROM mybb_settinggroups WHERE name = 'sceditor'

If anyone has encountered this problem, please help me.
Have you installed this plugin?
Why?
The sceditor is already integrated in MyBB.
The trouble is that rows is a reserved keyword in mariaDB.
Change the code of the plugin:

Original (lines 253 to 261)
function sceditor_is_installed()
{
	global $db;

	$query = $db->simple_select("settinggroups", "COUNT(*) as rows", "name = 'sceditor'");
	$rows  = $db->fetch_field($query, 'rows');

	return ($rows > 0);
}

Must become
function sceditor_is_installed()
{
	global $db;

	$query = $db->simple_select("settinggroups", "COUNT(*) as nbrows", "name = 'sceditor'");
	$rows  = $db->fetch_field($query, 'nbrows');

	return ($rows > 0);
}