I have this code below to insert serialized data in a field (order_pictures):
$pictures_id = unserialize($category->getOrderPictures());
array_push($pictures_id, $picture->getId());
$category->setOrderPictures(serialize($pictures_id));
It works ok the first time I execute it. At least, it stores b:0;
in the order_pictures
field.
But when I execute it again, the value of $pictures_id
is bool(false)
, and I expected an array type.
Any idea?
Regards
Javi