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