0
我得到错误:第1行第390列的错误:打开和结束标记不匹配:流派第0行和歌曲。带有while循环错误的PHP输出为XML
<?php
header("Content-type: text/xml");
echo "<?xml version='1.0' encoding='ISO-8859-1'?>";
echo "<songs>";
$sr = $_GET["sr"];
$conn = new PDO("mysql:host=localhost;dbname=xxxxx;","xxxxx","xxxxx");
$songresults = $conn->query("SELECT * FROM `smashhits` WHERE artist LIKE'%$sr%'");
while($row=$songresults->fetch())
{
echo "<id> ID: $row[ID] </id>";
echo "<song> Song: $row[song] </song>";
echo "<artist> Artist: $row[artist] </artist>";
echo "<year> Year: $row[year] </year>";
echo "<genre> Genre: $row[genre] <genre>";
echo "<quantity> Quantity: $row[quantity] </quantity>";
}
echo "</songs>"
?>
我会感谢谁知道什么是与上面的代码会错。
代码中的错字。你的第二个''应该是' ' –
Crackertastic
2014-09-30 19:58:16