Object of class stdClass could not be converted to string

后端 未结 6 968
时光说笑
时光说笑 2020-12-01 11:45

I am having a problem with PHP at the moment, I am getting this error,

Object of class stdClass could not be converted to string the error occurs when

6条回答
  •  执笔经年
    2020-12-01 12:34

    What I was looking for is a way to fetch the data

    so I used this $data = $this->db->get('table_name')->result_array();

    and then fetched my data just as you operate on array objects.

    $data[0]['field_name']

    No need to worry about type casting or anything just straight to the point.

    So it worked for me.

提交回复
热议问题