Error When Posting New Thread & Announcing Said Thread

Started by ^Raven^, November 15, 2004, 10:43:13 PM

Previous topic - Next topic

^Raven^

David asked me to post this bug report.  When creating a new thread I chose the Announce topic feature and received the following error message.

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 ')
GROUP BY mg.ID_GROUP
ORDER BY mg.minPosts, IF(mg.ID_GROUP
File: /home/warham/public_html/Sources/Post.php
Line: 1475
Jon Reinhart

Owner, CWF GameCast

Public Relations Coordinator, Battlestar Galactica Wiki

David

More like I said post it here since I don't know.  :P  He's running RC2.
This space for rent.

[Unknown]

Why bother announcing a topic on a board no one but administrators can access?

Should be fixed.

-[Unknown]

^Raven^

#3
Quote from: David on November 15, 2004, 10:46:11 PM
More like I said post it here since I don't know.  :P  He's running RC2.

Yeah, sorry about leaving out the RC2 part.

Thanks to you Unknown for fixing it.  Time for me to test if it works.

Just tested it and I still have the error.

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 ')
GROUP BY mg.ID_GROUP
ORDER BY mg.minPosts, IF(mg.ID_GROUP
File: /home/warham/public_html/Sources/Post.php
Line: 1475
Jon Reinhart

Owner, CWF GameCast

Public Relations Coordinator, Battlestar Galactica Wiki

Oldiesmann

#4
Try this:

Find
$request = db_query("
SELECT mg.ID_GROUP, mg.groupName, COUNT(mem.ID_MEMBER) AS num_members
FROM {$db_prefix}membergroups AS mg
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_GROUP = mg.ID_GROUP OR FIND_IN_SET(mg.ID_GROUP, mem.additionalGroups) OR mg.ID_GROUP = mem.ID_POST_GROUP)
WHERE mg.ID_GROUP IN (" . implode(', ', $board_info['groups']) . ")
GROUP BY mg.ID_GROUP
ORDER BY mg.minPosts, IF(mg.ID_GROUP < 4, mg.ID_GROUP, 4), mg.groupName", __FILE__, __LINE__);


Replace
$request = db_query("
SELECT mg.ID_GROUP, mg.groupName, COUNT(mem.ID_MEMBER) AS num_members
FROM {$db_prefix}membergroups AS mg
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_GROUP = mg.ID_GROUP OR FIND_IN_SET(mg.ID_GROUP, mem.additionalGroups) OR mg.ID_GROUP = mem.ID_POST_GROUP)
WHERE mg.ID_GROUP" . (count($board_info['groups']) > 1 ? " IN (" . implode(', ', $board_info['groups']) . ")" : " = '" . $board_info['groups'][0] . "') . "
GROUP BY mg.ID_GROUP
ORDER BY mg.minPosts, IF(mg.ID_GROUP < 4, mg.ID_GROUP, 4), mg.groupName", __FILE__, __LINE__);
Michael Eshom
Christian Metal Fans

^Raven^

Whereabouts am I to find that?  Also, is anyone else experiencing this problem?
Jon Reinhart

Owner, CWF GameCast

Public Relations Coordinator, Battlestar Galactica Wiki

Oldiesmann

Michael Eshom
Christian Metal Fans

^Raven^

Quote from: Oldiesmann on November 17, 2004, 11:29:09 AM
That's from Sources/Post.php

Ahh, thanks.  Unfortunately I don't have access to that and David will have to take care of it.  David, you mind handling this for me?
Jon Reinhart

Owner, CWF GameCast

Public Relations Coordinator, Battlestar Galactica Wiki

David

Getting an unexpected T_STRING error on line 1523, wasn't able to find it easily though.
This space for rent.

Oldiesmann

Try this

$request = db_query("
SELECT mg.ID_GROUP, mg.groupName, COUNT(mem.ID_MEMBER) AS num_members
FROM {$db_prefix}membergroups AS mg
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_GROUP = mg.ID_GROUP OR FIND_IN_SET(mg.ID_GROUP, mem.additionalGroups) OR mg.ID_GROUP = mem.ID_POST_GROUP)
WHERE mg.ID_GROUP" . (count($board_info['groups']) > 1 ? " IN (" . implode(', ', $board_info['groups']) . ")" : " = " . $board_info['groups'][0]) . "
GROUP BY mg.ID_GROUP
ORDER BY mg.minPosts, IF(mg.ID_GROUP < 4, mg.ID_GROUP, 4), mg.groupName", __FILE__, __LINE__);
Michael Eshom
Christian Metal Fans

David

Cool, no syntax errors this time around. :)  Thanks.
This space for rent.

Oldiesmann

Michael Eshom
Christian Metal Fans

^Raven^

Thank you guys.  I've been able to use the announcement option the last three times I needed to.  It worked!  Huzzah and lots of cheers to all of you.
Jon Reinhart

Owner, CWF GameCast

Public Relations Coordinator, Battlestar Galactica Wiki

Advertisement: