[eluser]Josh Kendall[/eluser]
Hi MMCCQQ, I think this is what you want.
Code:
/* You're Variables */
$cantidad = 4;
$topic_number = 1;
/* First Database Query */
$this->db->select('topic_id, forum_id, topic_title, topic_time');
$this->db->orderby('topic_time', 'desc');
$this->db->limit($cantidad);
$this->db->from('phpbb_topics');
$query = $this->db->get();
/* First Database Result */
$result = $query->result_array(); // = mysql_fetch_array();
/* Dealing with the While Loop */
$count = 0;
while($count < count($result)){
/* Second Database Query */
$titulo = substr(stripslashes($result[$count]['topic_title']),0,50);
$this->db->where('forum_id', $result[$count]['forum_id']);
$this->db->from('phpbb_forums');
$query2 = $this->db->get();
//Second Database Result
$result2 = $query2->result_array(); // = mysql_fetch_array();
$count++;
}
Hope this helps.