I want to uapdate a table field with an array.That means i have a table with name test.In that table i inserted some rows first.
After some process i want to update a filed in this table with ana array value.When i inserting rows into this table at that time this filed is set to 0.
After some process some values returned to a variable $var like:
Array
(
[id] => "http://www.google.com/calendar/"
[etag] => "GEwNTgxHfip7JGA6WhJV"
[link] => "http://www.google.com/calendar/"
)
This is the code iam using for updating field:
$idg= json_encode($var);
mysql_query("UPDATE `test` SET `tk` = '$idg' WHERE `TID` =10");
The above code is the edited code .The $idg now have:
{"id":"http:\/\/www.google.com\/calendar\/feeds\/testid%40gmail.com\/events\/64h9vc0qqqtlqeqhudhhdqbsds","etag":"\"GEwCQwxGeSp7JGA6WhJV\"\r","link":"http:\/\/www.google.com\/calendar\/feeds\/testid%40gmail.com\/private\/full\/64h9vc0qqqtlqeqhudhhdqbsds\r"}
After excuting this code the field will updated with null value.This is the problem facing now.
$varis an array. you need to access one of its element. like$var['id']