MyBB Community Forums

Full Version: SQL Error When actived the Plugin in CP
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I met a problem.

After upload the plugin “Guest Home”,the Plugin display in CP.
I active it but jump to the page:

MyBB SQL Error
MyBB has experienced an internal SQL error and cannot continue.
If you’re a visitor of this website,please wait a few minutes and try again,If this problem persists,please contact the site owner.
If you are the site owner,please check the MyBB Documentation for help resolving common issues,or get technical help on the MyBB Community Forums

OSBig Grinebian GNU/Linux 12
MyBB Ver:1.8.37
Plug-in:MyBB Guest Home #3 stable
That's a generic sql error.  You need to enable error checking to get the specific error.  See the docs for more detail:

https://docs.mybb.com/1.8/faq/errors/

There's also a support thread for this plugin, but don't see much recent activity.  It may not be working at all:

https://community.mybb.com/thread-231172.html
The error.log show below:
<error>
<dateline>1705302936</dateline>
<script></script>
<line>0</line>
<type>20</type>
<friendly_type>MyBB SQL Error</friendly_type>
<message>SQL Error: 1366 - Incorrect integer value: '' for column 'sid' at row 1
Query:
INSERT
INTO mybb_settings (sid,name,title,description,optionscode,value,disporder,gid)
VALUES ('','mybbguest_onoff','MyBB Guest Home','Enable or disable this plugin.','onoff','1',0,34)
</message>
<back_trace>#0 errorHandler->error() called at [/inc/db_mysqli.php:609]
#1 DB_MySQLi->error() called at [/inc/db_mysqli.php:345]
#2 DB_MySQLi->query() called at [/inc/db_mysqli.php:378]
#3 DB_MySQLi->write_query() called at [/inc/db_mysqli.php:842]
#4 DB_MySQLi->insert_query() called at [/inc/plugins/mybbguest.php:75]
#5 mybbguest_install_settings() called at [/inc/plugins/mybbguest.php:42]
#6 mybbguest_install() called at [/admin/modules/config/plugins.php:432]
#7 require() called at [/admin/index.php:830]
</back_trace>
</error>
Remove or comment the line #66 from the inc/plugins/mybbguest.php file:
"sid"            => NULL,
thanks to Crazycat!
I commented the line you refer and the plugin actived!
I actived the plugin "Guest Home",the Login page show the prompt strings:
"Welcome to XXX,Forum of Cracking,Sinful Site is a forum based on......"
I find the prompt strings in <inc\plugins\mybbguest.php>(line102~105).
Met a question:
After the prompt strings modified to new strings in mybbguest.php and update php file,
The prompt strings remain unchanged in Login page.
After having modified the text in the plugin, you have to uninstall and reinstall it, as it writes the global template index_guest.
Or you can just edit the template itself, but you'll have to do this again if you reinstall the plugin.
Thanks to CrazyCat!
Successfully solved my problem according to your instructions.