[eluser]harshitha[/eluser]
public function search() {
$q=$_POST['q'];
$config = array();
$config["base_url"] = base_url()."welcome/example1/";
$config["total_rows"] = $this->Countries->record_count($q);
$config["per_page"] = 1;
$config["uri_segment"] = 3;
$this->pagination->initialize($config);
$page = ($this->uri->segment(3)) ? $this->uri->segment(3) : 0;
$data["results"] = $this->Countries->fetch_countries($config["per_page"], $page,$q);
$data["links"] = $this->pagination->create_links();
$this->load->view("search", $data);
}
I use that code to show my search result, But when I clicked "2"or "3" linked in pager
it give following error, I am new to codeiganter,
A PHP Error was encountered
Severity: Notice
Message: Undefined index: q
Filename: controllers/welcome.php
Line Number: 23