Мой метод модели всегда дает «нет пользователя». Почему мой запрос никогда не возвращает строки?public function filter($page = 0, $offset = 5, $search = '')
{
$search = $this->input->post('search');
$row = $this->m_user->getAllFilterUsers($offset, $page, $search);
$data['usersTable'] = $row->result();
// more scripting
}
< /code>
model < /p>
public function getAllFilterUsers($offset, $count, $search)
{
if ($search != '') {
$this->db->where('user_position', 'client');
$this->db->where('user_status', $search);
}
$this->db->where('user_position','client');
$this->db->where('user_status','active');
$this->db->order_by('user_id', 'desc');
$UsersQuery = $this->db->get('tb_user', $offset, $count);
if($UsersQuery->num_rows>0){
return $UsersQuery;
} else {
$this->session->set_flashdata('message','No User Found');
redirect('cuser/filter','refresh');
}
}
Подробнее здесь: https://stackoverflow.com/questions/121 ... ond-parame