Welcome to Geeklog, Anonymous Monday, June 17 2024 @ 01:49 pm EDT

Geeklog Forums

SQL Error - Topics - New 1.39 Installation


Status: offline

robyoung

Forum User
Newbie
Registered: 03/19/04
Posts: 2
Account Preferences

Select checkbox to not show a topic

Save

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

.../geeklog/public_html/usersettings.php?mode=preferences&msg=6

Fri Mar 19 19:56:42 2004 - 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 'AND (tid NOT IN ('GeekLog')) ORDER BY sortnum' at line 1. SQL in question: SELECT tid,topic,owner_id,group_id,perm_owner,perm_group,perm_members,perm_anon FROM gl_topics AND (tid NOT IN ('GeekLog')) ORDER BY sortnum

Have to use browser back button, deselect topics, save again then error not displayed.

Any ideas? I don't use topics a whole lot so if it is possible to simply remove the ability for a user to select which topics they want to see, i'm up for that.
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Yep, that's a bug.

In lib-common.php, in function COM_showTopics(), change this line:
Text Formatted Code
$sql .= " AND (tid NOT IN ('" . str_replace( ' ', "','", $tids )
 
to read
Text Formatted Code
$sql .= " WHERE (tid NOT IN ('" . str_replace( ' ', "','", $tids )
 
i.e. replace the "AND" with "WHERE".

That should fix it.

bye, Dirk
 Quote

Status: offline

robyoung

Forum User
Newbie
Registered: 03/19/04
Posts: 2
Thanks Dirk. Worked like a charm! Never would have found that myself.
 Quote

All times are EDT. The time is now 01:49 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