Not Solved SQL Error with plugin activation
Not Solved
I want to install the following plugin ( HTML in Posts ) :
When I tried to activate it from the admin panel I have this error :
MyBB has experienced an internal SQL error and cannot continue.

In the php plugin file, the database insertion is like this :
function htmlposts_activate()
global $db, $lang;

// create settings group
$insertarray = array(
'name' => 'htmlposts', 
'title' => 'HTML in Posts', 
'description' => "Settings for HTML in Posts plugin.", 
'disporder' => 100, 
'isdefault' => 0
$gid = $db->insert_query("settinggroups", $insertarray);

I am on :
MyBB : MyBB 1.8.24
Server : 10.3.25-MariaDB-0+deb10u1 - Debian 10

In this post (, the advice is to go on this file to see the database creation :

I am not an expert so I have downloaded a random plugin with a recent last build :

In this plugin, the database creation is like this :
function abp_restricturl_install() {
global $db, $lang;
$settinggroups = [
 'name' => CN_ABPRURL,
 'title' => $lang->abp_restricturl_setting_title,
 'description' => $lang->abp_restricturl_setting_desc,
 'disporder' => 0,
 'isdefault' => 0
$db->insert_query('settinggroups', $settinggroups);
$gid = $db->insert_id();

Do I need to change the respective parts concerning this in the "HTML in posts" plugin ?
Last time, it activated but I was under MySQL.

Or maybe it's not this ^^'
Edit :
There is insertion of the line
"htmlposts" "HTML in Posts" "Settings for HTML in Posts plugin." "100" "0"
In the table "mybb_settinggroups"
Not Solved
Can you set SQL errors to show full details under Server Maintaince options in the ACP? This should give us a better idea.

Please do not PM me for support. I am looking to be hired for paid services.

You can view my paid services here.
Not Solved
I can obtain this :
SQL Error:
    1366 - Incorrect integer value: '' for column `bddname`.`mybb_settings`.`sid` at row 1
    INSERT INTO mybb_settings (`sid`,`name`,`title`,`description`,`optionscode`,`value`,`disporder`,`gid`) VALUES ('','htmlposts_groups','Allowed Groups','Enter the group IDs that can use HTML in posts. (separated by a comma, can be blank to allow all)','text','4',1,34) 
And contrary to the table "mybb_settinggroups", nothing is created in "mybb_settings".

Edit :
I have seen in my database that the column "sid" is on "Null" -> "No" and "Extra" -> "AUTO_INCREMENT".
I have deleted the following lines in the php plugin file :
"sid"			=> NULL,
I suppose that the sid column will be automatically incremented by one with the creation of the line.

It works.

Is it a misconfiguration of my database or the plugin should accept this ?

Edit2 :
I also have an SQL error with this plugin ( Lock - Sell content in hide tags for newpoints ) :

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
    1364 - Field 'description' doesn't have a default value
    INSERT INTO mybb_settinggroups (`name`,`title`,`disporder`,`isdefault`) VALUES ('lock','Lock Settings',1,0) 
I think for this one I should go with this : (equivalent plugin, needs database values transfer).

Forum Jump:

Users browsing this thread: 1 Guest(s)