我想在我的脚本中添加多个搜索字段。
控制器:
public function rekap(){
$user = $this->session->userdata('user');
if(empty($user)){
redirect(base_url());
}
$profile = $this->user_model->get_user($user['user_id']);
if($profile['status_user']=='Inactive' || $profile['token']!=$user['token']){
redirect(base_url('logout'));
}
$this->load->view('rekap');
}
模特:
public function rekap($season,$username,$game){
$this->db->where('id_season',$season);
$this->db->where('id_username',$username);
$this->db->where('game',$game);
$result = $this->db->get('log',10000,0);
return $data;
}
观点:
<div style='padding-left:10px'>
<div class='border-blur' style='padding:5px'>
<div style='padding-bottom:5px'>
<form class='uk-form' method='GET' action='<?php echo base_url('Report/rekap_detail'); ?>'>
<input name='season' type='text' placeholder='season' value='<?php echo $_GET['season']; ?>' />
<input name='id_username' type='text' placeholder='id_username' value='<?php echo $_GET['id_username']; ?>' />
<input name='game' type='text' placeholder='game' value='<?php echo $_GET['game']; ?>' />
<button class='uk-button uk-button-primary'><span class='fa fa-search'></span> Search</button>
</form>
</div>
我得到了这个erorr
遇到PHP错误
严重性:注意
消息:数组到字符串转换
文件名:database / DB_active_rec.php
行号:427遇到PHP错误
严重性:注意
消息:数组到字符串转换
文件名:database / DB_active_rec.php
行号:427
发生数据库错误
错误号码:1054
'where子句'中的未知列'Array'
SELECT * FROM(
log
)WHEREid_seasons
='0018'和id_username
= 数组ANDgame
=数组LIMIT 10000文件名:\ database \ DB_driver.php
行号:330