When I click on search button the data is being sent, I have verified that but I keep getting this error as soon as I click the button now:
A PHP Error was encountered
Severity: Warning
Message: Missing argument 1 for Admin::select()
Filename: controllers/Admin.php
Line Number: 52
Line number 52 is the start if the controller code.
View:
<form action="#" class="login-wrapper" method="get">
<div class="span12" align="center">
<input class="input span12 password" type="text" name="search" placeholder="search by name">
<div class="actions">
<input class="btn btn-danger" type="submit" name="sub" value="search now">
</div>
</div >
</form>
Controller:
public function select ($search){
$this->load->model('Login_model');
if(isset($_GET ['search']) && !empty($_GET['search'])) {
$search= $_GET[ 'search'];
$this->load->model('Login_model');
$result=$this->Login_model->selectorganizer($search)''
if($result)
{
$data['result']=$result;
$this->load->view('admin/show/org', $data);
}
else
{
redirect('admin/show');
}
}
}
Model:
public function selectorganizer ($search) {
$condition = "search = '" . $search . "'";
$this->db->select('*');
$this->db->from('organizer');
$this->db->where($condition);
$query = $this->db->get();
return $result = $query->result();
}
Your where condition is wrong in model file
Model
Controller