[eluser]pickupman[/eluser]
You are on the right track. A couple points to mention:
1.) When redirecting from your index function post() is only available on the page submit, so it's not being carried to your results page. Best set this in a users session
Code:
$this->session->set_userdata('location', $location);
2. You have to tell the pagination class how many records you want in each row
Code:
$config['per_page'] = 25;
3. You need to define your default offset.
Code:
$data['result'] = $this->db->get('properties',$config['per_page'] , $this->uri->segment(3,0));
4. Now that you have the person location stored in there session, you will need to update the model to reflect this.
Code:
function get_properties($num, $offset) {
$location = $this->session->userdata('location');
if(!empty($location)) return FALSE; //no location to search (maybe not necessary)
$this->db->where('location', $location);
$query = $this->db->get('properties', $num, $offset);
if($query->num_rows() > 0)
return $query->result(); //return result object rather than query object
return FALSE; //No results
}
You will find later on that returning result objects will be better off. And adding the return FALSE will help checking the model call, before processing any further.