Arkadaşlar bakın aşağıdaki kodlarla veri tabanından verileri çekip S_cache isimli klasöre headline.xml dosyasını oluşturuyoruyorum ama o xml dosyayı oluşturması için aşağıdaki php kodlarının bulunduğu sayfayı çalıştırmak gerekiyor benim istediğim ise şu : veritabanına veri eklendiğinde xml'e de girilen veri yazılsın... bunun için yardıma ihtiyacım var...


<?php

include("SYSTEM_common_config.php");
$dosya_adi = 'S_cache/headline.xml';
$xml_output .=  '<?xml version="1.0" encoding="ISO-8859-9"?>';
$xml_output .=  '<root><news>';


$sql = mysql_query("SELECT * FROM news WHERE news_location='1' ORDER BY id DESC limit 10", $baglanti) or die("Sorgu hatasi olustu !");
$row_sql = mysql_fetch_assoc($sql);
do 
{
$xml_output .=  '<item>';
$xml_output .=  '<title><![CDATA['.$row_sql['title'].']]></title>';
$xml_output .=  '<spot><![CDATA['.$row_sql['spot'].']]></spot>';
$xml_output .=  '<image>images/news/'.$row_sql['image'].'.jpg</image>';
$xml_output .=  '<link>news_detail.php?id='.$row_sql['id'].'</link>';
$xml_output .=  '<date><![CDATA['.$row_sql['__formated_date'].']]></date>';
$xml_output .=  '</item>';
} 
while($row_sql = mysql_fetch_assoc($sql));
$xml_output .=  '</news></root>';

$yaz=fopen($dosya_adi, "w");
fwrite($yaz,$xml_output);
fclose($yaz);
?>