I get this error after using Query_See_Board: Database Error: Unknown column 'b.member_groups' in 'where clause'
$request = $smcFunc['db_query']('', '
SELECT m.subject, t.id_topic
FROM {db_prefix}topics AS t
LEFT JOIN {db_prefix}messages AS m ON m.id_topic = t.id_topic
WHERE t.id_board IN({raw:inc_boards})
AND {query_see_board}
GROUP BY t.id_topic
ORDER BY t.id_topic {raw:sort}
LIMIT 0,{int:num_topics}',
array(
'num_topics' => (int) $num_topics,
'inc_boards' => implode(',', $inc_boards),
'sort' => $sort,
)
);
I'm not familiar with anything like this so is there a different variable I should use?
That's the wrong query, sorry, try enabling the setting that shows queries in the error log (nfi how it's called)
Try:
$request = $smcFunc['db_query']('', '
SELECT m.subject, t.id_topic
FROM {db_prefix}topics AS t
LEFT JOIN {db_prefix}messages AS m ON (m.id_topic = t.id_topic)
LEFT JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board)
WHERE t.id_board IN ({array_int:inc_boards})
AND {query_see_board}
GROUP BY t.id_topic
ORDER BY t.id_topic {raw:sort}
LIMIT 0,{int:num_topics}',
array(
'num_topics' => (int) $num_topics,
'inc_boards' => $inc_boards,
'sort' => $sort,
)
);
But exactly what are you trying to obtain? (since I feel there is a better way to do it)
ETA: @Yoshi: the query is wrong anyway because {query_see_board} wants the table {db_prefix}boards somewhere in the query. ;)
It's SSI Recent topics lol...
Was going to do a bug report, it should have query see board in it already. Trying what you said but here's the whole function (I copied it and edited it to have topics only or something I can't remember).
function BRSrecentTopics($num_topics, $inc_boards, $sort)
{
// Need $smcFunc, but make sure SSI.php is included BEFORE this is called)
global $smcFunc;
$request = $smcFunc['db_query']('', '
SELECT m.subject, t.id_topic
FROM {db_prefix}topics AS t
LEFT JOIN {db_prefix}messages AS m ON m.id_topic = t.id_topic
WHERE t.id_board IN({raw:inc_boards})
AND {query_see_board}
GROUP BY t.id_topic
ORDER BY t.id_topic {raw:sort}
LIMIT 0,{int:num_topics}',
array(
'num_topics' => (int) $num_topics,
'inc_boards' => implode(',', $inc_boards),
'sort' => $sort,
)
);
while ($row = $smcFunc['db_fetch_assoc']($request))
$topics[] = array(
'subject' => $row['subject'],
'id' => $row['id_topic'],
'link' => '<a href="http://www.bunnyrabbitsex.com/index.php?topic=' . $row['id_topic'] . '">' . $row['subject'] . '</a>',
);
return $topics;
}
Doesn't seem to be throwing errors, will let you know again tomorrow! <3
Also if you're talking about eval, it's not an issue on my forums ;).