【发布时间】:2023-03-08 11:38:01
【问题描述】:
我在执行搜索方法时无法获取更多参数。 这是我的网址 ->
所以我想在这里获取所有参数并传递给模型。
这是我的控制器
public function index($state,$searchCity,$searchPoscode,$searchJenisRumah,$searchBilangan)
{
$state=$this->input->get("state");
$data['search_result'] = $this->m_search->searchIndex($searchState,$searchCity,$searchPoscode,$searchJenisRumah,$searchBilangan);
$this->load->view('senarai-rumah', $data,$state);
}
这是我的模型
public function searchIndex($searchState,$searchCity,$searchPoscode,$searchJenisRumah,$searchBilangan){
$sql = "select * from house_rent where houseStateId = ? and houseDistrictId = ? and housePostcode = ? and houseType = ? and housePeople = ?;";
$query = $this->db->query($sql, array($searchState,$searchCity,$searchPoscode,$searchJenisRumah,$searchBilangan));
return $query->result();
}
所以错误显示 消息:未定义变量:状态
【问题讨论】:
标签: php codeigniter