I am creating an RSS feed that pulls both "Trains" and "Vintage Cars" from a database. When I run the code it reads, "This XML file does not appear to have any style information associated with it." Any advice would be helpful, thanks!
<?php
$dbc = mysqli_connect('localhost', 'USER', 'PW', 'DB')
or die('Error Connecting');
header('Content-type: text/xml');
echo '<?xml version="1.0" encoding="UTF-8"?>';
$builddate = gmdate(DATE_RSS, time());
?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Vintage Cars</title>
<atom:link href="http://<?= $_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']; ?>" rel="self" type="application/rss+xml" />
<link>http://localhost:8888/L9/index.php</link>
<description>Vintage Cars - Lesson 9</description>
<lastBuildDate><?= $builddate; ?></lastBuildDate>
<language>en-us</language>
<?php
$query = " SELECT * FROM products WHERE productLine = 'Vintage Cars', 'Trains' ORDER BY dateAdded DESC LIMIT 10 ";
$result = mysqli_query($dbc, $query)
or die("Error querying database => $query");
//Loop through and print data
while ($newArray = mysqli_fetch_array($result)) {
$product_code = $newArray['productCode'];
$name = $newArray['productName'];
$product_line = $newArray['productLine'];
$scale = $newArray['productScale'];
$vendor = $newArray['productVendor'];
$description = $newArray['productDescription'];
$buy_price = $newArray['buyPrice'];
}
?>
<item>
<title><?php echo $product_code - $name; ?></title>
<description><?php echo $description; ?></description>
<link>localhost:8888/L9/product.php?pid=<?= $product_code; ?></link>
<guid isPermaLink="false">localhost:8888/L9/product.php?pid=<?= $product_code; ?></guid>
<pubDate><?php echo $pubdate; ?></pubDate>
</item>
</channel>
</rss>