Hi alby, me again
Some other error I discoverd after logged into the frontend to show the forums.
Code: Select all
Debug: (3,011592) - (11846196)
<br>
(postgres7): SELECT f.id, f.name, f.description, COUNT(t.id) as topic_count
FROM module_forum_forums f LEFT JOIN module_forum_topics t ON f.id = t.forum_id
GROUP BY f.id, f.name, f.description
ORDER BY f.position, f.name<br>
Error (ERROR: column "f.position" must appear in the GROUP BY clause or be used in an aggregate function): ERROR: column "f.position" must appear in the GROUP BY clause or be used in an aggregate function<br>
No forum will be displayed on the frontend until I substitute
Code: Select all
$sql = "SELECT f.id, f.name, f.description, COUNT(t.id) as topic_count
FROM ".cms_db_prefix()."module_forum_forums f LEFT JOIN ".cms_db_prefix()."module_forum_topics t ON f.id = t.forum_id
GROUP BY f.id, f.name, f.description
ORDER BY f.position, f.name";
with
Code: Select all
$sql = "SELECT f.id, f.name, f.description, COUNT(t.id) as topic_count
FROM ".cms_db_prefix()."module_forum_forums f LEFT JOIN ".cms_db_prefix()."module_forum_topics t ON f.id = t.forum_id
GROUP BY f.id, f.name, f.description, f.position
ORDER BY f.position, f.name";
So, the forums displayed on the frontend. But adding a new topic fails! Here's the message that occured:
Code: Select all
Debug: (2,553122) - (11779564)
<br>
(postgres7): INSERT INTO module_forum_topics
(id, forum_id, last_post_id, poster_id, subject, closed, sticky, views)
VALUES ('2',1,-1,'3','Endlich wieder Offroad!','f',0,0)<br>
Error (ERROR: invalid input syntax for integer: "f"): ERROR: invalid input syntax for integer: "f"<br>
Regards,
Christian