map=array(); $this->updated=false; } public function set($key,$val) { $this->map[$key]=$val; $this->updated=true; } public function get($key) { return $this->map[$key]; } public function __destruct() { if($this->updated) { $this->updated=false; mysql_query("update serialized_data set data='".(serialize($this)."'")); } mysql_close(self::$link); } } ?>