This is the first time I tried to use inner join, and I have a problem with that where clause. Unknown column 'forumtype' in 'where clause' However if I delete there where clause, then I will get the same error with the ON clause. The forum table's ID is equal to the comment's table's TOPIC_ID. Please let me know if You need any further information.
$query = mysql_query("SELECT f.id AS forumid, f.class AS forumclass,
f.date AS forumdate, f.type AS forumtype, f.name AS forumname, f.author AS forumauthor,
f.user AS forumuser, f.url AS forumurl,
c.id AS commentid, c.user_id AS commenutuserid, c.user_name AS commentusername,
c.topic_id AS commenttopic, c.date AS commentdate
FROM ".$prefix."forum AS f
INNER JOIN ".$prefix."comment AS c
ON commenttopic = forumid
WHERE forumtype=1 AND forumclass='$c' ORDER BY commentdate DESC LIMIT $offset, $limit ") or die(mysql_error());