我得到错误数组到字符串转换我的控制器是
function index() {
if ($this->input->post('submit') != NULL) {
$data = array();
$data['username'] = $this->input->post('username');
$data['name'] = $this->input->post('name');
$result['data'] = $this->Useraccount_mod->getUser_list($data);
$data['userlist'] = $result['data'];
$this->load->view('Useraccount/Userlist', $data);
} else {
$data = array();
$result['data'] = $this->Useraccount_mod->getUser_list($data);
$data['userlist'] = $result['data'];
$this->load->view('Useraccount/Userlist', $data);
}
}
和型号
function getUser_list($data) {
if ($data) {
$this->db->like('username',$data);
$this->db->like('name',$data);
$query = $this->db->get('users');
return $query->result_array();
} else {
$query = $this->db->get("users");
return $query->result_array();
}
}
我错在哪里?请建议我
严重性:通知
消息:数组到字符串的转换
文件名:数据库/DB_query_builder.php
行号:980
回溯:
文件:C:\xampp\htdocs\ov400\application\models\Useraccount_mod.php 行:31 功能:like
文件:C:\xampp\htdocs\ov400\application\controllers\Users.php 行:23 功能:getUser_list
文件:C:\xampp\htdocs\ov400\index.php 行:315 功能:require_once
幕布斯7119047