header('Content-Type: text/xml');echo '<?xml version='1.0'?>'
echo '<rss version='2.0'>'
echo '<channel>'
echo '<title>Example.com Test RSS 2</title>'
echo '<description>Anytown Widgets and more! Click for The County's Internet Marketplace.</description>'
echo '<link>http://www.example.com/</link>'
echo '<copyright>Copyright 1998 - 2004 example.com. All Rights Reserved</copyright>'
<?php
include("../admin/config.php");
$sql = "SELECT category, adtext, id FROM classifieds WHERE postdate >= NOW() - INTERVAL 2 DAY AND status = 'a' ORDER BY RAND() DESC LIMIT 3";
$result = mysql_query($sql, $conn) or die (mysql_error());
//GO THROUGH EACH ROW IN THE RESULT AND DISPLAY DATA
while ($newArray = mysql_fetch_array($result)) {
//give a name to the fields
$category = $newArray['category'];
$adtext = $newArray['adtext'];
$id = $newArray['id'];
//WRITE ITEM INFO
fwrite ($fp, "<title>$category</title>");
fwrite ($fp, "<description>$adtext</description>");
fwrite ($fp, "<link>$id</link>");
fwrite ($fp, "<item>$item</item>");
}
?>
echo '</channel>'
echo '</rss>'