Hi all i am trying to select topics from many forums (in phpbb3) and this is the code:
And you see the "($forum)" well it currently only works if i use one number, but what if i want to select from more than one forum, how do i use more numbers in there?
PHP:
if (preg_match ("/^([0-9.,-]+)$/", $forum))
{
$sql = $db->sql_build_query('SELECT',
array(
'SELECT' => 'p.*, u.*',
'FROM' => array(
POSTS_TABLE => 'p',
USERS_TABLE => 'u',
),
'WHERE' => "p.topic_id = '{$topics[$i]['topic_id']}'
AND p.forum_id = '{$forum}'
AND p.poster_id = u.user_id",
'ORDER_BY' => "post_id ASC"
));
}
And you see the "($forum)" well it currently only works if i use one number, but what if i want to select from more than one forum, how do i use more numbers in there?




