MyBB Community Forums
Activation = Internal SQL Error - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: 1.8 Support (https://community.mybb.com/forum-175.html)
+--- Forum: General Support (https://community.mybb.com/forum-176.html)
+--- Thread: Activation = Internal SQL Error (/thread-213990.html)



Activation = Internal SQL Error - isoldehn - 2017-11-09

On activation of an Tagging Plugin! (1.3.4) (Created by flash.tato, I believe this was a 1.6 plugin modified for 1.8 compatibility, the files been in my computer so long I really can't remember) an internal SQL error occurs.

I've used this plugin on 7 other forums so far all running 1.8.7 --> up. Works perfectly and beautifully on each. EXCEPT THIS ONE.

I'm helping someone out with creating a skin/theme for their site and happened to be helping in this area too for this plugin.

Error message:
Quote:MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1101 - BLOB/TEXT column 'tags' can't have a default value
Query:
ALTER TABLE mybb_oct2017_posts ADD tags TEXT NOT NULL DEFAULT ''

Plugin file attached below as well as a screen shot. Any help would be appreciated.


http://crying-for-the-moon.digibase.ca/forums/index.php


RE: Activation = Internal SQL Error - .m. - 2017-11-09

you can try removing DEFAULT '' in line 25 of the plugin file
$db->query("ALTER TABLE  `" . $db->table_prefix . "posts` ADD  `tags` TEXT NOT NULL DEFAULT  ''");

Note: php files should be saved with utf-8 encoding without Byte Order Mark.
in general, we use editor like Notepad++ or file editor at web host panel


RE: Activation = Internal SQL Error - isoldehn - 2017-11-09

I use Code Writer (I believe it is similar to Notepad++ but something downloadable from the windows store).

It is now throwing this error:
Quote:SQL Error:
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '''' at line 1
Query:
ALTER TABLE mybb_oct2017_posts ADD tags TEXT NOT NULL ''



RE: Activation = Internal SQL Error - .m. - 2017-11-09

can you try below for that code line & check
$db->query("ALTER TABLE  `" . $db->table_prefix . "posts` ADD  `tags` TEXT NOT NULL");



RE: Activation = Internal SQL Error - isoldehn - 2017-11-09

I'm not quite sure if I understand what you mean by try below that line and check so here is another file of what it is at this moment after I removed the word "DEFAULT" on line 25.


RE: Activation = Internal SQL Error - .m. - 2017-11-10

well, single quotes ('') should be also removed after the word DEFAULT

remaining line (without DEFAULT '')
$db->query("ALTER TABLE  `" . $db->table_prefix . "posts` ADD  `tags` TEXT NOT NULL"); 



RE: Activation = Internal SQL Error - isoldehn - 2017-11-14

New error:

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1366 - Incorrect integer value: 'NULL' for column 'gid' at row 1
Query:
INSERT INTO mybb_oct2017_settinggroups (gid,title,name,description,disporder,isdefault) VALUES ('NULL','Tagging Plugin! Settings','tagging','Manage every single aspect of the Tagging Plugin!','4','0')


RE: Activation = Internal SQL Error - .m. - 2017-11-14

in the plugin file, can you replace NULL with 0 [zero] in below line, save the file & try again ..
 "gid"            => "NULL",



RE: Activation = Internal SQL Error - isoldehn - 2017-11-15

That worked! Thank you for the help! Smile