In mysql database, have data serialized by php as below:
"a:564:{s:13:\"caltime\";s:6:\"65.26\";
I use Rmysql to query these data, but donot know how to unserialize them in R.
Thank for any help!
In mysql database, have data serialized by php as below:
"a:564:{s:13:\"caltime\";s:6:\"65.26\";
I use Rmysql to query these data, but donot know how to unserialize them in R.
Thank for any help!
MySQL doesn't have any inbuilt function to unserialize data. You can't do it. You need to do from application level
if my data is :
$a= array( '1' => 'elem 1', '2'=> 'elem 2', '3'=>' elem 3');
$b=serialize($a);
then print_r($a) produce following o/p:
a:3:{i:1;s:6:"elem 1";i:2;s:6:"elem 2";i:3;s:7:" elem 3";}
and then print_r($b) produce following o/p:
Array ( [1] => elem 1 [2] => elem 2 [3] => elem 3 )
i hope its help you