A
A
Anton2017-06-14 07:36:26
CodeIgniter
Anton, 2017-06-14 07:36:26

Why does PHP swear at Codeignaiter code?

Php complains about
$this->db->update('mytable', $data, array('id' => $id));
Severity: Notice --> Array to string conversion
Error: Unknown column 'Array' in 'field list'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
ipokos, 2017-06-14
@ipokos

The essence of the error is that a string data type is expected, but an array comes.
Look in the db->update() method to see what data is being received.
I can assume that the format may be something like this:
$ data - data that you write.
$this->db->update('table_name', $data, 'column_name')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question