I am using infinite scroll. At first, I have to retrieve 5 records and on further scrolling down, I have to retrieve next 5 records. 
The query that I am using is as follows:

```
function profile1($uid) {
        $this->db->select('*');
        $this->db->from('posts');
        $this->db->where('user-id', $uid);
        $this->db->limit('5');
        $data = $this->db->get();
        return $data->result();
    }

```

But it is giving me only first 5 records.
Can any body tell me how can I get next five records?
And same thing should be continued till the last record is printed.
Thanks in advance...