PHP MYSQL RSS源限制问题

PHP MYSQL RSS源限制问题,php,mysql,rss,feed,Php,Mysql,Rss,Feed,我试图从MYsql数据库中整合一个RSS提要。但是脚本将只发布2个事件。如果限制设置为3或更多,则会显示错误消息: This page contains the following errors: error on line 26 at column 29: xmlParseEntityRef: no name 下面是第一个错误之前的页面呈现。这是我的代码: <?php header('Content-Type: text/xml'); mysql_connect("localhost"

我试图从MYsql数据库中整合一个RSS提要。但是脚本将只发布2个事件。如果限制设置为3或更多,则会显示错误消息:

This page contains the following errors:
error on line 26 at column 29: xmlParseEntityRef: no name
下面是第一个错误之前的页面呈现。这是我的代码:

<?php
header('Content-Type: text/xml');
mysql_connect("localhost", "username", "password") or die(mysql_error());
mysql_select_db("database") or die(mysql_error());

echo '<?xml version="1.0" encoding="ISO-8859-1"?>
<rss version="2.0">
<channel>
<title>My Website Name</title>
<description>A description of the feed</description>
<link>The URL to the website</link>';

$get_articles = "SELECT id, title, description,
DATE_FORMAT(start_date,'%a, %e %b %Y %T') as formatted_date
FROM table_name ORDER BY start_date DESC LIMIT 4";

$articles = mysql_query($get_articles) or die(mysql_error());

while ($article = mysql_fetch_array($articles)){

echo '
   <item>
      <title>'.$article[title].'</title>
      <description><![CDATA[
      '.$article[description].'
      ]]></description>
      <link>http://www.gigreview.com.au/index.php/gig-review/'.$article[id].'</link>
      <pubDate>'.$row[formatted_date].' GMT</pubDate>
  </item>';
}
echo '</channel>
</rss>';
?>

尝试通过以下方式验证XML-可能是它的标志,如&需要&-您可以尝试: