Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
error: Unknown column 'hide_stats' in 'where clause'
Avatar
Jeferson
Member
sp_UserOfflineSmall Offline
May 25, 2016 - 5:35 am

Hello,

 

Can someone help me out with this error: 

May 25, 2016 11:09 am | spaErrError | 2 | database


file: /var/www/html/BLA/wp-content/plugins/simple-press/forum/database/sp-db-statistics.php
line: 278
function: select
error: Unknown column 'hide_stats' in 'where clause'

SELECT SQL_CALC_FOUND_ROWS wpBLA_sfmembers.user_id, display_name, posts FROM wpBLA_sfmembers JOIN wpBLA_sfmemberships ON wpVGU_sfmembers.user_id = wpBLA_sfmemberships.user_id JOIN wpVGU_sfusergroups ON wpBLA_sfmemberships.usergroup_id = wpBLA_sfusergroups.usergroup_id WHERE hide_stats = 0 AND admin=0 AND moderator=0 AND posts > -1 GROUP BY wpBLA_sfmembers.user_id ORDER BY hide_stats ASC, posts DESC LIMIT 0, 5

 

I have restored an older version of the database when everything was still working but then I get the same error. 

I also did the network upgrade (of the DB) still no succes. 

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
May 25, 2016 - 6:04 am

Odd. This column was added to the table in the 5.6.6 update. If it had failed I would have expected the upgrade to error and clearly it dd not or you would have reported that (I assume anyway).

It was the only db change in the 5.6.6 update, And tis is the only report of a failure...

The only thing I can think of is to run a query against your database to create the column. Is that going to be possible? Or manually create it of course. I can give you a query or details.

But, of course, it is worrying. Could it be that the user who ran the update had no create column privilege with your mySQL server?

andy-signature.png
YELLOW
SWORDFISH
Avatar
Jeferson
Member
sp_UserOfflineSmall Offline
May 25, 2016 - 6:11 am

Hello,

 

Well the user had create roles in mysql. 
But we had some issues with updating so maybe it went wrong. 

Can you give me the SQL query's that where supposed to happen at update? 
That way I can execute them now. 

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
May 25, 2016 - 6:21 am

I was meaning actual create columns, tables etc., on the mysql server itself. They probably do as they will be using the same db login credentials as the main owner/adminintartor.

Can you describe the issues you had?

Here is the sql query.

ALTER TABLE xxx_sfusergroups ADD (hide_stats tinyint(1) unsigned NOT NULL default '0');

You need to swap the 'xxx' for your WP table prefix of course.

I am sorry to hear you had the probpem...

andy-signature.png
YELLOW
SWORDFISH
Avatar
Jeferson
Member
sp_UserOfflineSmall Offline
May 25, 2016 - 7:37 am

Thanks, this seems to have fix the issue. 

Yea but regarding the update you helped me out as well. It was due to an older version of PHP on our systems. 

So again, thank you very much!!!! 

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
May 25, 2016 - 7:52 am

My memory is not what it used to be 🙂

andy-signature.png
YELLOW
SWORDFISH
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 617
Members: 17359
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10125
Posts: 79620