i am trying to store an array as json in database using codeigniter website like below:
$this->db->insert('orders',
array('orderstatus' => $orderstatus,
'productname' => json_encode($product1)
)
);
the array has values like below:
Array
(
[0] => Array
(
[id] => 8
[productname] => Couple Combo Sherwani
[pimage] => _RJ_0149-min.jpg,_RJ_0342-min.jpg,_RJ_0115-min.jpg
[jrp] => 6000
[deposit] => 6000
[size] => XL
[duration] => 3
[quantity] => 1
)
)
the database looks like:
however in database the value is stored as below:
"Array"
can anyone please tell me what is wrong in here, thanks in advance
$product1, aprint_r($product1);for example