Posts: 517
Threads: 93
Joined: Dec 2019
Reputation:
32
2020-12-02, 08:48 PM
Hello everyone,
I am trying to install Top stats #7
https://community.mybb.com/mods.php?acti...ad&pid=269
and I am getting this error
https://forum.robloxscripts.com/admin/in...ig-plugins
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 mybbqd_settinggroups (`gid`,`name`,`title`,`description`,`disporder`,`isdefault`) VALUES ('NULL','topStats','Top Stats','Settingsfor plugin Top Stats.',89,'0')
Do I have to change something and How?
Thanks
Posts: 93
Threads: 16
Joined: Oct 2020
Reputation:
4
2020-12-03, 06:48 AM
(2020-12-02, 08:48 PM)Mastersly Wrote: Hello everyone,
I am trying to install Top stats #7
https://community.mybb.com/mods.php?acti...ad&pid=269
and I am getting this error
https://forum.robloxscripts.com/admin/in...ig-plugins
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 mybbqd_settinggroups (`gid`,`name`,`title`,`description`,`disporder`,`isdefault`) VALUES ('NULL','topStats','Top Stats','Settingsfor plugin Top Stats.',89,'0')
Do I have to change something and How?
Thanks
Either disable MySQL strict mode or change "NULL" to 0 in the plugin file.
Posts: 2,571
Threads: 100
Joined: Feb 2007
Reputation:
306
2020-12-03, 07:40 AM
(This post was last modified: 2020-12-03, 07:41 AM by Crazycat. Edited 1 time in total.)
No.
Disabling MySQL strict mode will work, but if you can't (and it's better to not do that), remove 'gid' => 'NULL', from Topstats.settings.php :
$settings_group = array(
'name' => 'topStats',
'title' => $db->escape_string($lang->topStats),
'description' => $db->escape_string($lang->topStats_Desc),
'disporder' => $max_disporder + 1,
'isdefault' => '0'
);
This field is auto-increment, send 0 will create an error.
Same for all 'sid' => 'NULL',
Posts: 93
Threads: 16
Joined: Oct 2020
Reputation:
4
2020-12-03, 04:20 PM
(2020-12-03, 07:40 AM)Crazycat Wrote: No.
Disabling MySQL strict mode will work, but if you can't (and it's better to not do that), remove 'gid' => 'NULL', from Topstats.settings.php :
$settings_group = array(
'name' => 'topStats',
'title' => $db->escape_string($lang->topStats),
'description' => $db->escape_string($lang->topStats_Desc),
'disporder' => $max_disporder + 1,
'isdefault' => '0'
); This field is auto-increment, send 0 will create an error.
Same for all 'sid' => 'NULL',
Why is it better to keep strict mode on? Genuinely asking as I've seen turning it off provided as a solution several times by developers on this forum.
Posts: 517
Threads: 93
Joined: Dec 2019
Reputation:
32
2020-12-03, 05:21 PM
I changed "NULL" to "0" at topStats.settings.php and topStats.tpl.php
thank you guys, it works now
Posts: 93
Threads: 16
Joined: Oct 2020
Reputation:
4
2020-12-03, 05:50 PM
(2020-12-03, 05:21 PM)Mastersly Wrote: I changed "NULL" to "0" at topStats.settings.php and topStats.tpl.php
thank you guys, it works now
Well Crazycat just said that you shouldn't do that as it will provide errors. I just want to make sure that doesn't happen down the road. Maybe once they answer we can get some more clarification.
Posts: 2,571
Threads: 100
Joined: Feb 2007
Reputation:
306
2020-12-03, 11:04 PM
(This post was last modified: 2020-12-03, 11:07 PM by Crazycat. Edited 1 time in total.)
(2020-12-03, 04:20 PM)tomjay78 Wrote: Why is it better to keep strict mode on? Genuinely asking as I've seen turning it off provided as a solution several times by developers on this forum. Two reasons:
1. depending on your hoster, you can't disable that (we had examples of users in the community who can't because hoster refuse)
2. strict mode forces to have the most standard queries, which fully respect SQL language, so you're sure that the compatibilty with different engines (MySQL, mariaDB, potentially pgsql) exists and you won't have trouble with next versions of DB engines
And if strict mode becomes a standard, I think it's better to update the plugins to be compatible with standards rather than force users to change their server settings.
I did PHP developments in PHP 3, when PHP standard became 4, 5... then 8 now, I've updated my devels, I didn't explain how to force usage of old PHP versions.
Posts: 93
Threads: 16
Joined: Oct 2020
Reputation:
4
2020-12-04, 05:01 AM
(2020-12-03, 11:04 PM)Crazycat Wrote: (2020-12-03, 04:20 PM)tomjay78 Wrote: Why is it better to keep strict mode on? Genuinely asking as I've seen turning it off provided as a solution several times by developers on this forum. Two reasons:
1. depending on your hoster, you can't disable that (we had examples of users in the community who can't because hoster refuse)
2. strict mode forces to have the most standard queries, which fully respect SQL language, so you're sure that the compatibilty with different engines (MySQL, mariaDB, potentially pgsql) exists and you won't have trouble with next versions of DB engines
And if strict mode becomes a standard, I think it's better to update the plugins to be compatible with standards rather than force users to change their server settings.
I did PHP developments in PHP 3, when PHP standard became 4, 5... then 8 now, I've updated my devels, I didn't explain how to force usage of old PHP versions.
Very interesting. I do agree that it's mostly always best to adopt the new "standard". Thank you for the detailed explanation.
|