Hello, I recieve XML error: "Only one top level element is allowed in an XML document." when I try to run my sitemap script in PHP:
$num_rows = mysql_num_rows(mysql_query("SELECT * FROM pages_content WHERE date < CURRENT_TIMESTAMP"));
$result = mysql_query("SELECT * FROM pages_content WHERE date < CURRENT_TIMESTAMP ORDER BY id DESC") or die("Query failed");
echo '<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84">';
for($i=0;$i<$num_rows; $i++) {
$url_product = 'http://www.hostcule.com/'.mysql_result($result,$i,"title");
echo'
<url>
<loc>'.$url_product.'</loc>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
';
echo '</urlset>'; }
What's wrong with it?