Welcome to Geeklog, Anonymous Thursday, November 28 2024 @ 08:00 pm EST

Geeklog Forums

Error when e-mailing stories as anonymous


Status: offline

rv8

Forum User
Regular Poster
Registered: 10/10/02
Posts: 105
Location:Ottawa, Canada

I took a look at my error.log this morning, and found a large number of errors like:

1064: You have an error in your SQL syntax near '' at line 1 SQL in question: SELECT email FROM gl_users WHERE uid =

If I try to e-mail a story as anonymous, "1064: You have an error in your SQL syntax near '' at line 1" shows up in the browser, and the error shows up in the error log.

I searched on this site, and found this story that looks to about the exact same problem. The item mentions several possible fixes, but the authors speculate about potential issues with each fix. Is there a good fix for this problem available?

Thanks,


Kevin Horton
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
I still can't reproduce this and I have no idea why it is happening (as already explained in the comments to the story you're linking to). Any input on this issue would be welcomed. bye, Dirk
 Quote

Status: offline

rv8

Forum User
Regular Poster
Registered: 10/10/02
Posts: 105
Location:Ottawa, Canada

I read the previous item on this issue again, and I realize that I had misunderstood one of Dirk's comments. I thought he was saying that if I replaced "username" with "uid" that this could cause problems. He didn't say that. He said that this line of code appears in other places, so other parts of the GL functionality may also be having problems.

I edited profiles.php around line 212. It originally said:

if (!empty ($_USER['username'])) { $result = DB_query("SELECT email FROM {$_TABLES['users']} WHERE uid = {$_USER['uid']}");

I replaced 'username' with 'uid'. Everything seems to work OK.

I see in the error log that there was a problem with an anonymous user trying to submit a comment a few minutes ago, so I guess I'll have to do the same surgery to comment.php. I was wondering why I hadn't gotten any comments for the last 10 days.

---
Kevin


Kevin Horton
 Quote

All times are EST. The time is now 08:00 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