[eluser]yoelrodguez[/eluser]
Hello as I can maintain the value of a WHERE in a pagination. Which disappears when I change of page
my code
Data Table
$this->db->select($sql_query);
$this->db->where($campo, $value);
$q = $this->db->get($from,$per_page,$segment);
$data["customers"]=array();
if ($q->num_rows() > 0)
{
foreach ($q->result() as $row)
{
$data["customers"][$row->id]["id"] = $row->id;
$data["customers"][$row->id]["nombre"] = $row->nombre;
}
}
return $data["customers"];
Pagination:
$this->load->library('pagination');
$config['base_url'] = base_url().'index.php/cinmueble/index';
$config['total_rows'] = $total;
$config['per_page'] = $per_page;
$config['num_links'] = $num_links;
$config['first_link'] = $first_link;
$config['last_link'] = $last_link;
$this->pagination->initialize($config);