ppalex7 / SourceComms

Providing extended, temporary and permanent punishments with full history storing in sourcebans system.
11 stars 7 forks source link

sql error in sourcebans log #5

Closed Nomy closed 11 years ago

Nomy commented 11 years ago

Error: [code]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')) as gag_count, UNIX_TIMESTAMP() as c_time FROM sb_comms AS CO FORCE INDE' at line 5

Query: SELECT CO.bid ban_id, CO.type, CO.authid, CO.name player_name, created ban_created, ends ban_ends, length ban_length, reason ban_reason, CO.ureason unban_reason, CO.aid, AD.gid AS gid, adminIp, CO.sid ban_server, RemovedOn, RemovedBy, RemoveType row_type, SE.ip server_ip, AD.user admin_name, MO.icon as mod_icon, CAST(MID(CO.authid, 9, 1) AS UNSIGNED) + CAST('76561197960265728' AS UNSIGNED) + CAST(MID(CO.authid, 11, 10) * 2 AS UNSIGNED) AS communityid, (SELECT count() FROM sb_comms as BH WHERE (BH.authid = CO.authid AND BH.authid != '' AND BH.authid IS NOT NULL AND BH.type = 1)) as mutecount, (SELECT count() FROM sb_comms as BH WHERE (BH.authid = CO.authid AND BH.authid != '' AND BH.authid IS NOT NULL AND )) as gag_count, UNIX_TIMESTAMP() as c_time FROM sb_comms AS CO FORCE INDEX (created) LEFT JOIN sb_servers AS SE ON SE.sid = CO.sid LEFT JOIN sb_mods AS MO on SE.modid = MO.mid LEFT JOIN sb_admins AS AD ON CO.aid = AD.aid

  WHERE CO.aid='64'

ORDER BY CO.created DESC LIMIT 0,60[/code]

Function: /home/public_html/sourcebans/includes/adodb/adodb.inc.php - 916
/home/public_html/sourcebans/includes/adodb/adodb.inc.php - 872
/home/public_html/sourcebans/pages/page.commslist.php - 367
/home/public_html/sourcebans/includes/page-builder.php - 105
/home/public_html/sourcebans/index.php - 23

Query: p=commslist&advSearch=64&advType=admin

MySQL client version: 5.5.29

ppalex7 commented 11 years ago

I am sorry, I made this mistake at one of the previous updates. I will fix it at the next day.

ppalex7 commented 11 years ago

Fixed! Please update your page.commslist.php and page_comms.tpl

Also, please run following sql queries: ALTER TABLE sb_comms DROP INDEX reason; ALTER TABLE sb_comms DROP INDEX authid_2; ALTER TABLE sb_comms DROP INDEX name;

Nomy commented 11 years ago

Thanks Alex! :+1: