[eluser]Flemming[/eluser]
You need to pass the previous max to the function each time - you could do this either by changing the URL, e.g.
/yoursite.com/controller/method/3 (where 3 is the max ID you just got from your query)
or you could store the last max ID in a session
either way, you then need to update your query so that it gets theID which is LESS than the previous ID:
Code:
public function getSites($last_id = null) {
$this->db->select('*');
if($last_id)
{
$this->db->where('site_id <', $last_id);
}
$this->db->order_by('site_id', 'DESC');
$this->db->limit(1);
$query = $this->db->get('sites');
return $query->result_array();
}