MyBB Community Forums

Full Version: MySQL Error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello everyone. When I was trying to edit a user group (name color, title, stars, description and anything in the "edit user group" page), I get the following error;


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

SQL Error:
1054 - Unknown column 'gpcss6' in 'field list'

Query:
UPDATE mybb_usergroups SET gpcss1='', gpcss2='', gpcss3='', gpcss4='', gpcss5='', gpcss6='', gpcss7='' WHERE gid='6'

[gid number in the error changes regarding to user group I'm trying to edit]


My forum's version is 1.8.21 and running PHP 7.3.

I know where I screwed up exactly. I have this Group Post CSS plugin and wanted to upgrade/update it. Downloaded the new files, overwrited them all and did anything else. Plugin itself has no ACP options page and I can't deactivate the plugin by ACP, because then gives me that error;


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

SQL Error:
1091 - Can't DROP COLUMN gpcss1; check that it exists

Query:
ALTER TABLE mybb_usergroups DROP gpcss1


I didn't want to delete it's files from FTP manually because probably the problem in database will persist. I want to use this plugin and reinstalling is okay if it'll solve the problem. But generally speaking, I don't really understand how to upgrade/update a plugin and don't know if there's anything else to do except for overwriting the updated files.

Also, I've checked mybb_usergroups and gpcss1-2-3-4-5 in PHPMyAdmin, after I clik gpcss1 (and others), I get the following error;

SQL: SELECT * FROM mybb_usergroups ORDER BY mybb_usergroups.gpcss1 ASC LIMIT 0, 25 MySQL
MySQL: #1054 - Unknown column 'mybb_usergroups.gpcss1' in 'order clause'

Thanks for the help!

I finally fixed it by myself. So, here is the solution. After I've recieved this error, I logged into my PHPMyAdmin and see if there're any colums named gpcss1-2-3-4 and 5. These are the columns that should be created by Group Post CSS plugin in table (tableprefix_usergroups). They were there alright but I noticed that there also should've been columns gpcss6 and 7, which they should've been created by the latest update of the plugin, 2.3. But I was using 2.2 and I overwrited the 2.3 files before deactivating the plugin. So, since I never deactivated the old version of the plugin and then actitaved it, it never created number 6. and 7. columns. Then I deleted the plugin's files in FTP manually (2.3 files) and uploaded the version 2.2 files. After I tried to deactivate the plugin, it gave me an error, plugin was there but columns were missing. So, I added the columns in PHPMyAdmin with this;

ALTER TABLE mybb_usergroups
ADD gpcss1 varchar(1500) not null,
ADD gpcss2 varchar(1500) not null,
ADD gpcss3 varchar(1500) not null,
ADD gpcss4 varchar(1500) not null,
ADD gpcss5 varchar(1500) not null;

Then, I deactived the plugin in ACP (by doing this, it's also deleting the columns we created) and it worked. Problem solved!
Thanks for sharing the solution.