Welcome to Geeklog, Anonymous Saturday, December 21 2024 @ 08:26 am EST

Geeklog Forums

1064: You have an error in your SQL syntax near '' at line 1.


Status: offline

Mikez

Forum User
Regular Poster
Registered: 06/17/05
Posts: 87
I have been doing my best trying to piece my database back together.
And now that I think I got it all.
It's letting me log in and out.
But anyone else they get a An SQL error has occurred. Please see error.log for details.

And in my error log I get

Text Formatted Code
1064: You have an error in your SQL syntax near '' at line 1. SQL in question: DELETE FROM fw_sessions WHERE uid =
 


What am I missing.
I did not install my full database because the updates wont work with my old database.

My site has been down for 4 days now.
Please help.
 Quote

Status: offline

Mikez

Forum User
Regular Poster
Registered: 06/17/05
Posts: 87
A new user can log in and use the site fine.
So it's something missing.
what SQL Tables need to be Transfered to let someone log in.

 Quote

Status: offline

Mikez

Forum User
Regular Poster
Registered: 06/17/05
Posts: 87
And yes I have tryed to remove the entryes in it.
Still get.

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

and in the log

Sun Jun 19 12:08:41 2005 - error in get_userdata
Sun Jun 19 12:08:41 2005 - 1064: You have an error in your SQL syntax near '' at line 1. SQL in question: DELETE FROM fw_sessions WHERE uid =
Parsed in 0.028 seconds, using GeSHi 1.0.6
 Quote

Nygrah

Anonymous
I have this exact same problem. only I get "DELETE FROM gl_sessions WHERE uid =" at the end of mine. Have you fixed the problem? I sure could use some help. I need my old users to be able to acess my new site. I backed up the site from another database backup and now I am the only one that can get into the site.
 Quote

Status: offline

matthewcox

Forum User
Junior
Registered: 12/11/03
Posts: 31
Location:Asheville, North Carolina
I just upgraded and ran into similar problems myself.

Alot of the problems can occur with cookie overlap issues.
Overlaps can occur in two scenarios:
1) old cookies stored from pre-upgrade with new cookie
2) from running multiple geeklogs on the same domain

To test if this is the case delete your cache and cookies and see if you still have the problem. (if not, I'll talk about another issue next)

In my case, I installed the new geeklog in different directory first so that I could test it out on a duplicate copy(renamed) of the database.

When swithching back and forth between the two I occasionall got SQL errors similar to yours. Clearing my cookies would temporarily fix this.

If your running 2 or more instances of geeklog you can make sure that all of your cookie names are different between the config.php files

Text Formatted Code

$_CONF['cookie_session']                = 'gl_session';  // make unique like 'gl_session_site1'
$_CONF['cookie_name']                   = 'geeklog';  // make unique 'geeklog_site1'
$_CONF['cookie_password']               = 'password'; // same as above, do the same for the rest
$_CONF['cookie_theme']                  = 'theme';
$_CONF['cookie_language']               = 'language';
$_CONF['cookie_lastvisit']              = 'LastVisit';
$_CONF['cookie_lastvisittemp']          = 'LastVisitTemp';


 


In particular, both of your errors mention errors with "WHERE uid"
uid is retrieved from the cookie_name which tells me both of your config.php files have the same setting for this cookie. for years I had set this value to my site name. Now, after actually looking into this problem I discovered that it was actually referring to the username ie uid)



Arrowclearing cache and cookies didn't fix it
Other errors still related to cookies is themes. Upgrading to the more current releases doesn't work with many of the old themes. You should set your default to professional in the beginning. But setting it in config.php will only help new and anonymous users. Even if you clear the cookie that pointed to the old theme, your personal default theme will still be stored in the database and will reset when you try to login.

Try these to things to fix this
1)in config.php turn off 'allow_user_themes' by setting it to zero
$_CONF['allow_user_themes'] = 0;

2)Backup your old themes (you should have already done this anyway)
make directories named after your old themes and copy the contents of the professional theme into them


Oh, yeah. There's also an FAQ.
Geeklog FAQ - I can't login

Good luck! -Matthew Cox
 Quote

Nygrah

Anonymous
How do I go about deleting the cache and cookies because none of the other things worked? Is this something I need to do to the database backend itself?
 Quote

Status: offline

matthewcox

Forum User
Junior
Registered: 12/11/03
Posts: 31
Location:Asheville, North Carolina
Quote by Nygrah: How do I go about deleting the cache and cookies because none of the other things worked? Is this something I need to do to the database backend itself?


No, this is in your web browser. nothing to do with the server.

for example:
In Firefox this is in the Tools -> Options -> Privacy -> Cookies & Cache sections

In IE it's in Tools -> Internet Options -> "Delete cookies" & "Delete Files"


-Matthew Cox
     16  Quote

Nygrah

Anonymous
dah!!! I did that. I thought maybe you were talking about something else. Even if I get the users to change their password nothing happens. I had several versions of my database back up and I think I ran each of them at least once to make sure I got the latest info from the backup. Do you think they overlapped each other and if so what can I do to reset the database? Should I try erasing the database all together doing a new setup of geeklog and do one new backup install?
 Quote

Status: offline

matthewcox

Forum User
Junior
Registered: 12/11/03
Posts: 31
Location:Asheville, North Carolina
Quote by Nygrah: dah!!! I did that. I thought maybe you were talking about something else. Even if I get the users to change their password nothing happens. I had several versions of my database back up and I think I ran each of them at least once to make sure I got the latest info from the backup. Do you think they overlapped each other and if so what can I do to reset the database? Should I try erasing the database all together doing a new setup of geeklog and do one new backup install?


Did you try giving all your cookie variables new names yet?

Here's what I did to my config.php that finally got things to work.
Notice I added 1311(for version 1.3.11) to each cookie name to make sure that all new cookies get set.

Text Formatted Code
$_CONF['cookie_session']                = 'matthewcox_gl1311';
$_CONF['cookie_name']                   = 'gl_name1311';
$_CONF['cookie_password']               = 'password1311';
$_CONF['cookie_theme']                  = 'theme1311';
$_CONF['cookie_language']               = 'language1311';
$_CONF['cookie_lastvisit']              = 'LastVisit1311';
$_CONF['cookie_lastvisittemp']          = 'LastVisitTemp1311';

$_CONF['cookie_ip']                     = 1;
$_CONF['default_perm_cookie_timeout']   = 28800;
$_CONF['session_cookie_timeout']        = 7200;
$_CONF['cookie_path']                   = '/';
$_CONF['cookiedomain']                  = '.matthewcox.org'; // e.g. '.example.com'
$_CONF['cookiesecure']                  = 0;

 


Also, what version are you upgrading from? I ended up doing mine in two stages from 1.3.8sr6 to 1.3.9 to 1.3.11sr1 (I know. I shouldn't have waited so long to upgrade).

-Matthew Cox
 Quote

Status: offline

matthewcox

Forum User
Junior
Registered: 12/11/03
Posts: 31
Location:Asheville, North Carolina
Doh! - that was a mistakeOkay, sorry. Please ignore my previous tips.

I looked at my error logs to see that my SQL error was 1054 not 1064 like yours. 1064 is a SQL Query parse error.

"DELETE FROM gl_sessions(or fw_sessions)" is called from lib-common.php with the following line:
(gl_ prefix comes from your config.php database prefix setting, thus the reason Mikez's says fw_sessions, you guys probably have the same exact problem)

Text Formatted Code

// Clear out any expired sessions
DB_query( "DELETE FROM {$_TABLES['sessions']} WHERE uid = 1 AND start_time < " . ( time() - $_CONF['whosonline_threshold'] ));

 


check your lib-common.php to see if yours matches this. If it does, then you may have a mysql version compatibility issue. Find out which version you have of mysql you have by going to http://yoursite/admin/install/info.php

-Matthew Cox
 Quote

Nygrah

Anonymous
i do have that line in the lib-common file. I checked mysql version which is 4.0.16 what does that all mean? What should the version be?
 Quote

Status: offline

matthewcox

Forum User
Junior
Registered: 12/11/03
Posts: 31
Location:Asheville, North Carolina
Okay, so it continues....Giving it a try

ArrowWell your mysql version should be fine. The FAQ says that it's compatible with version 4 but less than 4.1


ArrowSo again I ask what geeklog version are you upgrading from? (and I'm assuming your trying to upgrade to 1.3.11sr1) This could help the dev team familiar with the upgrade scripts to possibly figure out what went wrong


ArrowAlso, disable all plugins. Make sure that all your plugins are current and compatible with 1.3.11. This is easier to do before the upgrade but if you're comfortable with phpMyadmin you could turn them off by editing the database manually. In the mySQL plugins table set the pi_enabled entries to 0. Only enable them after you have verified you have the current versions and they are compatible.


ArrowYour database might have gotten corrupted from multiple upgrade attemps. It wouldn't hurt to dump your mysql database completely and reload a backup. Or create an new database, upload the pre-upgrade database to it, and change your $_DB_name in config.php.


Arrowrepair and optimize on your geeklog database tables using phpMyadmin


ArrowYou said you had that line in lib-common.php but did you check that it was identical character for character(even spaces)?

-Matthew Cox
 Quote

Status: offline

andyofne

Forum User
Chatty
Registered: 08/31/02
Posts: 69
Realizing this is very late and not helpful to the original submitter, perhaps it might help someone else later.

I had a big problem when i installed phpbbbridge on my site and then tried to import an existing phpbb forum into the geeklog intregrated bridge.

I "imported" the user data from phpbb into the gl_users table by manually typing the data in using the "insert row" option. I didn't think about the gl_userprefs table until I created a 'test user' and noticed that the size increased on the user prefs table as well as the users table.

I then simply inserted generic data for each of my 37 old phpbb users and they could then log in.

So, this may not be the problem for everyone but it was for me.

 Quote

All times are EST. The time is now 08:26 am.

  • 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