Welcome to Geeklog, Anonymous Thursday, November 28 2024 @ 10:48 pm EST
Geeklog Forums
Error when e-mailing stories as anonymous
rv8
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
Dirk
rv8
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
- 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