<?

header("Content-type: text/xml\n\n");
echo '<?xml version="1.0" encoding="UTF-8"?>'."\n";
echo '<!-- generated-on="'.date("d M Y H:i").'" -->'."\n".'<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'."\n";

$db = mysql_connect("localhost", "deneme", "deneme");
mysql_select_db("deneme",$db);

echo "<urlset>";
$query = mysql_query("SELECT * FROM tablo");
while($yazi = mysql_fetch_assoc($query)) {
$link = "http://www.domain.com/".$yazi[title].".html";
echo "
 <url>
  <loc>".$link."</loc>
  <lastmod>".$yazi[date]."</lastmod>
  <changefreq>always</changefreq>
  <priority>0.9</priority>
</url>";
}
echo "
</urlset>";

?>