Im trying to save serialized arrays into my mysql database then retrive them and unserilize them but I cant work out how to unserialize them. here is what I have so far:
$query = mysql_query("SELECT friends FROM users WHERE id='$myid'");
$friends = mysql_fetch_array($query);
unserialize($friends);
Stuck here ?????
array_push($friends, $id);
$friendsUpdated = serialize($friends);
mysql_query("UPDATE users SET friends='$friendsUpdated' WHERE id='$myid'");