0

Hi,

getting error as
This page contains the following errors:

error on line 2 at column 1: Extra content at the end of the document
Below is a rendering of the page up to the first error.

for following code. please help me to resolve this

<?php
header("Content-Type: text/xml"); 
$xmlBody = '<?xml version="1.0" encoding="ISO-8859-1"?>';
$xmlBody .= "<XML>";

 mysql_connect("localhost","root","") or die("sorry");
 mysql_select_db("shri");

$sql = mysql_query("SELECT * FROM payment ORDER BY paydate DESC LIMIT 0, 4");
while($row = mysql_fetch_array($sql)){

    $payid = $row["payid"]; 
    $paystatus = $row["status"];  
    $payamount = $row["payamount"];  
    $cnum = $row["cnum"];  
     $xmlBody .= '
<payment> 
    <payid>' . $payid . '</payid> 
    <paystatus>' . $paystatus . '</paystatus>
    <payamount>' . $payamount . '</payamount>
    <cnum>' . $cnum . '</cnum>
</payment>';
} // End while loop
mysql_close(); 
$xmlBody .= "</XML>";
echo $xmlBody; 
?>
2
Contributors
2
Replies
10
Views
3 Years
Discussion Span
Last Post by shrikanthnk
0

You may have a zero width character at the end of your file? Copy the text and place into a clean file and save as UTF-8 without BOM

Maybe?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.