MyBB Community Forums

Full Version: mySQL error trying to install MyTabs
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Getting this message when trying to 'Activate' the plugin MyTabs: https://community.mybb.com/mods.php?acti...w&pid=1337

"MyBB has experienced an internal SQL error and cannot continue."

SQL Error:
1062 - Duplicate entry '1' for key 'PRIMARY'

Query:
INSERT INTO mybb_mytabs_settings (id,name,value) VALUES (1,'enabled','1'), (2,'default_tab_code','<td class="thead" style="border: 1px solid black; margin-right: 5px; padding: 2px 5px 2px 5px;">\r\n <div>\r\n <a href="{$link}">{$name}</a>\r\n </div>\r\n</td>\r\n'), (3,'default_selected_tab_code','<td class="thead" style="border: 1px solid black; margin-right: 5px; padding: 2px 5px 2px 5px;">\r\n <div>\r\n <strong><a href="{$link}">{$name}</a></strong>\r\n </div>\r\n</td>'), (4,'tab_list_code','<table border="0" cellspacing="1" cellpadding="1" class="tdborder">\r\n <tr>\r\n {$tablist}\r\n </tr>\r\n</table>'), (5,'default_tab','1'), (6,'ajax','1')"


URL: https://yakultureclub.com/

Anyone that might know the issue?
You already have a record whit id 1 in mybb_mytabs_settings.
Looks like you didn't deactivate the plugin correctly before trying to activate it again.
Drop the tables mybb_mytabs and mybb_mytabs_settings, then activate the plugin.
(2020-11-28, 11:04 PM)Crazycat Wrote: [ -> ]You already have a record whit id 1 in mybb_mytabs_settings.
Looks like you didn't deactivate the plugin correctly before trying to activate it again.
Drop the tables mybb_mytabs and mybb_mytabs_settings, then activate the plugin.

thanks so much for the response.

i dropped those tables and attempted to activate the plugin and now receive this:

SQL Error:
1136 - Column count doesn't match value count at row 2

Query:
INSERT INTO mybb_mytabs_settings (name,value) VALUES ('enabled','1'), (2,'default_tab_html','<a href="{$link}" style="margin-right: 6px;"> <div style="display: inline-block; padding: 10px; border: 1px solid #858787; color: black; background-color: #BABCBC;"> {$name} </div></a>'), (3,'default_selected_tab_html','<a href="{$link}" style="margin-right: 6px;"> <div style="display: inline-block; padding: 10px; border: 1px solid #49B0D8; color: black; background-color: #8CDEFF;"> {$name} </div></a>'), (4,'tab_list_html','<div class="trow2" style="border: 1px solid #ccc; margin: 0px 2px 20px 2px; padding: 10px;"> {$tablist}</div>'), (5,'default_tab','1'), (6,'ajax','0')
Have you made changement in the plugin file ? The query has changed.
(2020-11-29, 08:52 AM)Crazycat Wrote: [ -> ]Have you made changement in the plugin file ? The query has changed.

hmm i did not, i just dropped the tables by running the scripts in the phpmyadmin
Well, the script does: $db->insert_query_multiple('mytabs_settings', $default_settings); and default settings are [id, name, value].
The query cannot remove the "id" from the insert, so it means there is a trouble with your plugin. Download a fresh version and overwrite existing files, then try again.
(2020-11-29, 03:31 PM)Crazycat Wrote: [ -> ]Well, the script does: $db->insert_query_multiple('mytabs_settings', $default_settings); and default settings are [id, name, value].
The query cannot remove the "id" from the insert, so it means there is a trouble with your plugin. Download a fresh version and overwrite existing files, then try again.

you're right. downloaded the original and it worked just fine: https://community.mybb.com/mods.php?action=view&pid=456

thanks so much, i hope the "fixed" version does not deter other people as well.