0
一個PHP錯誤遇到笨錯誤datadase和數組到字符串轉換
Severity: Notice
Message: Array to string conversion
Filename: database/DB_active_rec.php
Line Number: 428
數據庫出錯
Error Number: 1054
Unknown column 'Array' in 'where clause'
SELECT * FROM (`user`) WHERE `id` = Array
Filename: C:\xampp\htdocs\shopping\system\database\DB_driver.php
Line Number: 331
我的模型
function update_customer($id)
{
$this->db->where('id', $id);
$query = $this->db->get('user');
return $query;
}
我控制器
function save_order()
{
$customer = array(
'name' => $this->input->post('full_name'),
'email' => $this->input->post('email'),
'address' => $this->input->post('address'),
'phone' => $this->input->post('telp')
);
$this->cart_model->update_customer($customer);
}
我不知道我的錯誤在哪裏,請更正,謝謝
您需要使用DB->更新更新時http://www.codeigniter.com/user_guide/database/query_builder.html#updating-data – user4419336