<?php
include ('xml.php');

$filename = "map.xml";
$handle = fopen($filename, "r");
$contents = fread($handle, filesize($filename));

fclose($handle);

$link = mysql_connect('mysql.networds.pl', 'michal_lab', 'nemo121');
if (!$link) {
   die('Could not connect: ' . mysql_error());
}

$db_selected = mysql_select_db('networds', $link);

$arr=XML_unserialize($contents);

$arr['map']['points']['point'][7]['description']=mb_convert_encoding($arr['map']['points']['point'][7]['description'], "ISO-8859-2","UTF-8");

mysql_query ("SET NAMES latin2");
$query='INSERT INTO xxx VALUES ("'.$arr['map']['points']['point'][7]['description'].'")';
echo $query;

echo "<br><br>";

if (mysql_query($query)) echo "OK";
else {
	echo "FALSE";
	echo mysql_errno($link) . ": " . mysql_error($link). "\n";

}
mysql_close($link);
?>