Update Database Field Error CodeIgniter

前端 未结 5 608
悲&欢浪女
悲&欢浪女 2021-02-04 08:18

I am getting the following error message in CodeIgniter 2.1:

A PHP Error was encountered

Severity: Notice

Message: Array to string conversion

Filename: databa         


        
5条回答
  •  长情又很酷
    2021-02-04 09:11

    try this hope its work

    function update2($data){
       foreach($data as $string_val){
       $this->db->update_batch('users',$string_val, "id");
        }
    }
    

    or

    function update2($data){
       foreach($data as $string_val){
       $this->db->update_batch('users',$string_val->first_name, "id");
        }
    }
    

提交回复
热议问题