I am trying to implement Pagination into my searchresults page. I\'ve asked this question yesterday with no succes Records not limited on searchpage using codeigniter pagination
You need your limit/offset inside the $query
string:
$query = "SELECT * FROM (`bedrijfcategorieen`)
JOIN `bedrijven` ON `bedrijfcategorieen`.`idbedrijven` = `bedrijven`.`idbedrijven`
JOIN `categorieen` ON `bedrijfcategorieen`.`idcategorieen` = `categorieen`.`idcategorieen`
WHERE (`Bedrijfsnaam` LIKE '%".$this->input->post('search')."%'
OR `Plaats` LIKE '%".$this->input->post('search')."%'
OR `Telefoonnummer` LIKE '%".$this->input->post('search')."%'
OR `Email` LIKE '%".$this->input->post('search')."%'
OR `Website` LIKE '%".$this->input->post('search')."%'
OR `Profiel` LIKE '%".$this->input->post('search')."%'
OR `Adres` LIKE '%".$this->input->post('search')."%'
OR `Categorie` LIKE '%".$this->input->post('search')."%')
AND (Postcode IN ($string))
GROUP BY `Categorie`, `bedrijfcategorieen`.`idbedrijven`
LIMIT ".$offset.", ".$limit;
$result = $this->db->query($query);
return $result->result_array();