$strXML = "
// Connect to the DB
$link = connectToDB();
$strQuery = "SELECT DST_IP,
COUNT(DST_IP) AS NumOccurrences
FROM traffic
GROUP BY DST_IP HAVING ( COUNT(DST_IP) > 1 )
ORDER BY NumOccurrences DESC";
$result = mysql_query($strQuery) or die(mysql_error());
if ($result) {
while($ors = mysql_fetch_array($result))
{
$strXML .= "
echo "Det GB Accses ";
echo $ors['DST_IP'];
}
}
mysql_close($link);
$strXML .= "
$filename = 'artists.xml'; // here put the xml file name
if (is_writable($filename)) {
if (!$handle = fopen($filename, "a+")) {
//fgets($handle);
echo "Cannot open ($filename)";
exit;
}
if (fwrite($handle, $strXML) === FALSE) {
echo "Cannot write to ($filename)";
exit;
}
echo "Success, wrote ($strXML) to ($filename)";
fclose($handle);
} else {
echo "The file $filename is not writable";
}
ICC WORLD CUP 2011 WATCH LIVE ONLINE
How to create XML file using PHP
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment