• Welcome to Simple Machines Community Forum. Please login or sign up.
December 01, 2021, 08:47:33 AM

News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord


Query_See_Board Issues

Started by Jade Elizabeth, September 23, 2012, 01:48:16 PM

Previous topic - Next topic

Jade Elizabeth

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?
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

NanoSector

That's the wrong query, sorry, try enabling the setting that shows queries in the error log (nfi how it's called)
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

emanuele

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. ;)


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Jade Elizabeth

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;

}

Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Jade Elizabeth

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 ;).
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Advertisement: