1 (edited by hostpinnacle 2005-03-29 15:30)

Topic: PunBB reported: Unable to fetch topic info

I suddenly get this error when posting a new topic w/ my admin user.

An error was encountered
File: /home/hostpin/public_html/community/viewtopic.php
Line: 98

PunBB reported: Unable to fetch topic info

Database reported: Unknown column 's.user_id' in 'field list' (Errno: 1054)

In viewtopic.php it says

if (!$pun_user['is_guest'])
    $result = $db->query('SELECT t.subject, t.closed, t.num_replies, t.sticky, f.id AS forum_id, f.forum_name, f.moderators, fp.post_replies, s.user_id AS is_subscribed FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'subscriptions AS s ON (t.id=s.topic_id AND s.user_id='.$pun_user['id'].') LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id='.$id.' AND t.moved_to IS NULL') or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error());
else
    $result = $db->query('SELECT t.subject, t.closed, t.num_replies, t.sticky, f.id AS forum_id, f.forum_name, f.moderators, fp.post_replies, 0 FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id='.$id.' AND t.moved_to IS NULL') or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error());

When I looked in my mysql db the column doesn't exist like it said in the code.

Re: PunBB reported: Unable to fetch topic info

The subscriptions table should have two columns: user_id and topic_id
Both primary keys, both int(10) unsigned with a default 0.
Your subscription table is missing user_id?