\r\n"; $_xml .="\r\n"; $_xml .="\r\n"; $_xml .="YarnsandFibers Textile Statistics\r\n"; $_xml .="http://www.yarnsandfibers.com\r\n"; $_xml .="YarnsandFibers Textile Statistics\r\n"; $_xml .="en\r\n"; $_xml .="[email protected]\r\n"; $_xml .="YarnsandFibers\r\n"; $_xml .="".date("r")."\r\n"; $_xml .="".date("r")."\r\n"; $_xml .="\r\n"; $_xml .="YarnsandFibers Textile Statistics\r\n"; $_xml .="http://www.yarnsandfibers.com/preferredsupplier/images/nhp/ynfx_logo.png\r\n"; $_xml .="http://www.yarnsandfibers.com/mis/\r\n"; $_xml .="\r\n"; for($i=0; $i<$num; $i++) { $id = mysql_result($result,$i,"id"); $title = mysql_result($result,$i,"header"); $body = substr(mysql_result($result,$i,"body"),0,300); str_replace($remove,"",$body); $date_ir = mysql_result($result,$i,"date"); $country = mysql_result($result,$i,"country"); $COUNTRY_news = unserialize($country); $sql="select name from ynfx_mis_country where id = '$COUNTRY_news[0]' and enable='1'"; $result1=mysql_db_query($DATABASE,$sql); if(mysql_error()) error("Unexpected ERROR"); $country = mysql_result($result1,0,"name"); $product = mysql_result($result,$i,"product"); $PROD_news = unserialize($product); $sql="select name from ynfx_mis_product where id = '$PROD_news[0]' and enable='1'"; $result3=mysql_db_query($DATABASE,$sql); if(mysql_error()) error("Unexpected ERROR"); $product = mysql_result($result3,0,"name"); $_xml .="\r\n"; $_xml .="".str_replace($remove,"",$title)."\r\n"; $_xml .="http://www.yarnsandfibers.com/mis/indexis.php\r\n"; $_xml .="".$product."\r\n"; $_xml .="".date("r",$date_ir)."\r\n"; $_xml .="".str_replace($remove,"",$body)."\r\n"; $_xml .="\r\n"; } $_xml .="\r\n"; $_xml .="\r\n"; fwrite($file, $_xml); fclose($file); } header("location:statistics.xml"); echo "XML has been written. View the XML."; ?>