I want to show all data from mysql database and use xml format. But it show the error message "error on line 2 at column 205: Extra content at the end of the document" How can fix it?
<?php
extract($_REQUEST);
include ('connect.php');
if ($result_no = $conn->query("SELECT * FROM enxml")){
while ($row_no = $result_no->fetch_object()){
$xml = '';
$xml .= '<stationList>';
$xml .= '<station no="' . $row_no->no . '">' ;
$xml .= '<location>'. $row_no->location .'</location>';
$xml .= '<lat>'.$row_no->lat.'</lat>';
$xml .= '<lng>'.$row_no->lng.'</lng>';
$xml .= '<type>'.$row_no->type.'</type>';
$xml .= '<districtL>'.$row_no->districtL.'</districtL>';
$xml .= '<districtS>'.$row_no->districtS.'</districtS>';
$xml .= '<address>'.$row_no->address.'</address>';
$xml .= '<provider>'.$row_no->provider.'</provider>';
$xml .= '<parkingNo>'.$row_no->parkingNo.'</parkingNo>';
$xml .= '<img>'.$row_no->img.'</img>';
$xml .= '</station>';
$xml .= '</stationList>';
header("Content-Type:text/xml");
echo $xml;
}
}
?>