MyBB Community Forums

Full Version: SQL error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
SQL error: also, how to fix?
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 tu1e_settinggroups WHERE name = 'miunashoutbox'' at line 1Query:SELECT COUNT(*) as rows FROM tu1e_settinggroups WHERE name = 'miunashoutbox'
There is problem in your "Miuna Shoutbox" plugin as it uses reserved word 'rows' in line number '48'.

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

Delete the shoutbox plugin file and problem will be resolved. (I can give a fix for the plugin, but not on system right now.)

Edit: Fix for the plugin

Line 48, change
	$query	= $db->simple_select("settinggroups", "COUNT(*) as rows");
	$dorder = $db->fetch_field($query, 'rows') + 1;

to

	$query	= $db->simple_select("settinggroups", "COUNT(*) as r");
	$dorder = $db->fetch_field($query, 'r') + 1;

and line 449, change

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

to

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

Save the file, reupload.
This should solve the issue.
Thank you, it helped me.