Welcome Guest, Not a member yet? Register   Sign In
Issue with serialized arrays and active record
#1

[eluser]jsuissa[/eluser]
When I pass a serialized array to a function in my model, the database update fails.

But when I serialize the array inside the data array of the model everything works.

This seesm very strange and I'm wondering if there is something else going on?
The issue only happens with serialized arrays?

This works:
Code:
$data = array(
$field => serialize($value)
);

$this->db->where($whereField, $whereValue);
$this->db->update($table, $data);

This doesn't work:

In controller: serialize($col);

Code:
$data = array(
$field => $value
);

$this->db->where($whereField, $whereValue);
$this->db->update($table, $data);




Theme © iAndrew 2016 - Forum software by © MyBB