MyBB Community Forums

Full Version: Activation = Internal SQL Error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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
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 ''
can you try below for that code line & check
$db->query("ALTER TABLE  `" . $db->table_prefix . "posts` ADD  `tags` TEXT NOT NULL");
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.
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"); 
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')
in the plugin file, can you replace NULL with 0 [zero] in below line, save the file & try again ..
 "gid"            => "NULL",
That worked! Thank you for the help! Smile