Advertisement:

Author Topic: Query_See_Board Issues  (Read 8859 times)

Offline Jade Elizabeth

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,629
  • Gender: Female
  • Keep your enemies close and your friends closer ;)
    • jadetrainor on LinkedIn
    • @alundra on Twitter
    • Jades-World
Query_See_Board Issues
« on: September 23, 2012, 01:48:16 PM »
I get this error after using Query_See_Board: Database Error: Unknown column 'b.member_groups' in 'where clause'

Code: [Select]
$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 forum: Color Me Forum/Patreon.

Offline NanoSector

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 10,467
  • Gender: Male
  • VC321xb47@aperture:~#
    • Yoshi2889 on GitHub
Re: Query_See_Board Issues
« Reply #1 on: September 23, 2012, 02:00:09 PM »
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."

Offline emanuele

  • SMF Super Hero
  • *******
  • Posts: 14,156
  • Gender: Male
  • THERE'S JUST ME
Re: Query_See_Board Issues
« Reply #2 on: September 23, 2012, 02:05:12 PM »
Try:
Code: [Select]
$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.

Offline Jade Elizabeth

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,629
  • Gender: Female
  • Keep your enemies close and your friends closer ;)
    • jadetrainor on LinkedIn
    • @alundra on Twitter
    • Jades-World
Re: Query_See_Board Issues
« Reply #3 on: September 23, 2012, 02:37:28 PM »
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).

Code: [Select]
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 forum: Color Me Forum/Patreon.

Offline Jade Elizabeth

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,629
  • Gender: Female
  • Keep your enemies close and your friends closer ;)
    • jadetrainor on LinkedIn
    • @alundra on Twitter
    • Jades-World
Re: Query_See_Board Issues
« Reply #4 on: September 23, 2012, 02:40:29 PM »
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 forum: Color Me Forum/Patreon.