setting a number of topics

I have a file that gets news articles from a table. I am trying to figure out how to make it only select a set number of topic/articles


 
$news_fora_id = array('2'); // Change in the fora id's you need
 $query = "
     SELECT p.topic_id, p.forum_id, p.post_time, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid,
         u.user_id, u.user_email, u.username, u.user_posts, u.user_rank, u.user_colour, u.user_allow_viewonline, u.user_allow_viewemail,
             (
                 SELECT COUNT( post_id )
                 FROM " . POSTS_TABLE . "
                     WHERE topic_id = p.topic_id
             ) AS aantal_posts
     FROM " . POSTS_TABLE . " AS p, " . USERS_TABLE . " AS u
         WHERE " . $db->sql_in_set( 'p.forum_id', 3) . "
             AND u.user_id = p.poster_id
     GROUP BY topic_id
     ORDER BY topic_id DESC
 ";
 //die('<pre>' . $query );
 $result = $db->sql_query( $query );
 $recruit_sql = "SELECT * FROM evo_recruit WHERE `ID`='1'";
 $recruit_result = mysql_query($recruit_sql);
 $rect = mysql_fetch_array($recruit_result);
 if ($rect[Status] == 'Open')
 

if the entire file is needed please let me know but that is the selection code. Please don’t put blah blah selection to the quary as I got told on another very unhelpful site.

Sponsor our Newsletter | Privacy Policy | Terms of Service