[eluser]j4zzyh4ck3r[/eluser]
[quote author="BenKxK" date="1302156696"]If you use $query->result() you can pass it to the view e.g. $data['last_ten'] and then in the view you can call the info (in a foreach loop etc) as $last_ten->User_Username.[/quote]
[quote author="InsiteFX" date="1302179327"]Something like this.
Code:
function get_last_ten_entries()
{
$entries = array();
$query = $this->db->get('entries', 10);
if ($query->num_rows() > 0)
{
foreach ($query->result_array() as $row)
{
$entries[] = $row;
}
}
$query->free_result();
return $entries;
}
InsiteFX[/quote]
Thanks for your help, it works :p