Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Rejected] SQL Error: 1064 - You have an error in your SQL syntax
#1
Hello there

I switched to a new server when I enter the add-ons in the admin panel.

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 = 'myinsertbuttons'' at line 1 Query: SELECT COUNT(*) as rows FROM mybb_settinggroups WHERE name = 'myinsertbuttons'
Please contact the MyBB Group for technical support.

why is this the cause and how can I fix it

do not look up for english
Reply
#2
The keyword rows is a reserved keyword. See here.
Plugin Count: I lost count.
Public Plugins are available here.
Official GitHub.
Please do not PM me for support unless asked to.
Reply
#3
(08-10-2018, 11:59 AM)Wires Wrote: The keyword rows is a reserved keyword. See here.

Thank you for your interest

I do not understand from the link you give me how to find a solution
Reply
#4
Unfortunately this issue is because of reserved words for MariaDB which cannot be used. This will be fixed in one of future releases.
[MyBB 1.8 Czech translation] [MyBB 1.8 plugins]: Prune old PMs + optimize DB plugin --- Thank you/like system
Reply
#5
(08-21-2018, 07:30 PM)Eldenroot Wrote: Unfortunately this issue is because of reserved words for MariaDB which cannot be used. This will be fixed in one of future releases.
I just migrated my forum from a crappy server to a better one at a new host, and went through the painstaking process of upgrading from 1.8.12 all the way to 1.8.19, one version at a time lol.

However, this issue appears to not yet be resolved in 1.8.19; I'm also getting the same error as above when visiting Configuration > Plugins.

As a test, I entered the query directly in the SQL box in phpMyAdmin, with quotes around the offending word: rows

SELECT COUNT(*) as "rows" FROM mybb_settinggroups WHERE name = 'myinsertbuttons'

That works just fine at my new host running MariaDB server version 10.2

Is there any way we can modify whatever MyBB script(s) is/are responsible for creating these queries ourselves while waiting for this fix to be included? If so, can some guidance be given as to what should be changed and where?

As it is now, I cannot access any plugins to reactivate them since the migration. Sad
Reply
#6
MyBB has this in core? I am not sure ...
Please state which plugins are installed in your setup.

There is no setting called "myinsertbuttons" in default MyBB. That belongs to a plugin.

Edit:
Looks like you are using martec's My Insert Buttons plugin. There are 2 instances in the plugin:

Line 46:

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

and line 94:

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

Change the rows to something else and it should fix the issue:
For example:

	$query = $db->simple_select("settinggroups", "COUNT(*) as r", "name = 'myinsertbuttons'");
	$rows  = $db->fetch_field($query, 'r');
[Image: logo.svg.svg]
Reply
#7
Ah yep, you're right, the queries are in the plugin.

And that's not the only one I have installed with similar queries, so got some editing to do.

Thanks for spotting that. Smile
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)