Advertisement:

Author Topic: Query_See_Board Issues  (Read 1485 times)

Offline Jade Elizabeth

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 11,167
  • Gender: Female
  • Keep your enemies close and your friends closer ;)
    • @BunnyRabbitSex on Twitter
    • BunnyRabbitSex
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
I'm for HIRE! | Check out my Fiverr Jobs! | Let's play games on OMGPOP together!


Need More Posts?

Quote
[12:13am] <%Jade> link me
[12:14am] <+orstio> <a href="Jade">link</a>


Offline Yoshi

  • Customizer
  • SMF Hero
  • *
  • Posts: 8,161
  • Gender: Male
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 / [WIP] Mod Builder / GitHub profile / "A programmer is just a tool which converts caffeine into code."
Quote
<FLAMER> Marketing is about to get into drug activities maybe... but we will see about that later on :P
<Yoshi2889> We're getting free drugs?
<CoreISP> He's talking about caffeine man, damn pen lifter.

Offline emanuele

  • Developer
  • SMF Super Hero
  • *
  • Posts: 11,908
  • Gender: Male
  • Because Orange is Orange
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. ;)

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: 11,167
  • Gender: Female
  • Keep your enemies close and your friends closer ;)
    • @BunnyRabbitSex on Twitter
    • BunnyRabbitSex
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
I'm for HIRE! | Check out my Fiverr Jobs! | Let's play games on OMGPOP together!


Need More Posts?

Quote
[12:13am] <%Jade> link me
[12:14am] <+orstio> <a href="Jade">link</a>


Offline Jade Elizabeth

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 11,167
  • Gender: Female
  • Keep your enemies close and your friends closer ;)
    • @BunnyRabbitSex on Twitter
    • BunnyRabbitSex
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
I'm for HIRE! | Check out my Fiverr Jobs! | Let's play games on OMGPOP together!


Need More Posts?

Quote
[12:13am] <%Jade> link me
[12:14am] <+orstio> <a href="Jade">link</a>