Welcome to Geeklog, Anonymous Monday, October 02 2023 @ 06:15 pm EDT

Geeklog Forums

SQL Error


Hi. We have a small swimming team website powered by Geeklog. I've just inherited the administration of this site as the person who created and maintained it is no longer with the club. I don't really know much about Geeklog so I'm learning on the fly (no one with the team really knows anything about the software). I haven't made any changes to the site in about a week, but we started receiving the following error 3 days ago when hitting the main page:

An SQL error has occurred. Please see error.log for details.

When I check the error log, this is the error:

Mon Oct 20 21:23:12 2008 - Setting cookiedomain='.spdyswimming.com'
Mon Oct 20 21:23:12 2008 - ***Inside SESS_sessionCheck***
Mon Oct 20 21:23:12 2008 - session cookie not found from lib-sessions.php
Mon Oct 20 21:23:12 2008 - ***Leaving SESS_sessionCheck***
Mon 20 Oct 2008 21:23:12 MDT - 1064: 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 ) at line 1. SQL in question: SELECT DISTINCT ft_name FROM gl_access,gl_features WHERE ft_id = acc_ft_id AND acc_grp_id IN ()

Does anyone have any suggestion on where to start to figure out what is going on? Any help at all would be greatly appreciated.


Status: offline


Forum User
Full Member
Registered: 08/04/03
Posts: 1298
Did you check if the hoster changed anything?


No I haven't yet. Is that something that would be affected by the hoster? It seems like it would be a query coming from the site. I will give them a call, though.


Sounds like you MIGHT have a corrupt gl_sessions table in your database. Check your tables and do a repair and optimize on the database.



That's where I get a little lost. I haven't tried to log directly into the database before, and I don't really know how. Can somebody point me in the right direction? How do I do a repair and optimize once I'm in? Thanks for all the help.

Status: offline


Forum User
Full Member
Registered: 08/05/03
Posts: 969
Location:The Netherlands, where else?
Does your hosting account offer phpMyAdmin? You can login to your database with the normal database username and password with phpMyAdmin, and repair/optimise the database quite easy.
Dutch Geeklog sites about camping/hiking:
www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net


This is the guy you inherited it from.
Evan - I just emailed Eric my cell number - get it from him and call me directly (and I'll give you the info to get on the phpMyAdmin)
Just started looking at this today. I'm seeing the same error codes, but the database from the phpMyAdmin console looks fine (all the error checks have come up clean).
For each table entry, tried Operations -> table maintenance -> check table (and also analyze table), but for each one, came back with "OK" or "Table is already up to date" - so if our gl_sessions table was corrupt, we would've gotten a different reply, right?
Also, If anyone else can possibly help with this, I saw the http://www.geeklog.net/trackback.php/geeklog-1.4.0sr2 article with the security vulnerability mentioned - Today I tried renaming the affected files with .old extension and imported the new ones. This didn't fix the problem (obviously) and codes in the error log are still the same.
Since that didn't help anything, will probably restore everything to its previous state.
If the database is coming up error-free, what other options are there?


I got us back up!
I created a new database named ****2 and uploaded a backup file from 2006 to it. Then changed config.php setting to match the restored database.
Unfortunately, we're back to 2006 because no one has backed up a database since then.
Anyway, I'll help you with updating everything and I'll walk you through everything else in the meantime.
Do feel free to call me on my cell (get it from Eric).


If you have a problem with the sessions table, just run this sql from phpmyadmin

it will remove the sessions table and then recreate it, no need to keep anything in there.

This is for 1.4.11 by the way, you might want to check to see if this is the same code as in 1.5. Either way, you can look in your 2006 backup and find the query and just use that.

DROP TABLE IF EXISTS `gl_sessions`;
CREATE TABLE `gl_sessions` (
`sess_id` int(10) unsigned NOT NULL default '0',
`start_time` int(10) unsigned NOT NULL default '0',
`remote_ip` varchar(15) NOT NULL default '',
`uid` mediumint(8) NOT NULL default '1',
`md5_sess_id` varchar(128) default NULL,
PRIMARY KEY (`sess_id`),
KEY `sess_id` (`sess_id`),
KEY `start_time` (`start_time`),
KEY `remote_ip` (`remote_ip`)


Status: offline


Site Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by: graymerica

it will remove the sessions table and then recreate it, no need to keep anything in there.

While that's correct, I would always try to repair the table first.
Text Formatted Code
REPAIR TABLE gl_sessions;

bye, Dirk

All times are EDT. The time is now 06:15 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content