With PHP how all echo does not come out of XML, is what about the problem Ah
Source: Internet
Author: User
With PHP how all echo not out of XML, what is the problem ah?
Require_once ("conn.php");
Header ("Content-type:text/xml");
$query = ' SELECT * from Test ORDER by no Desc ';
$result =mysql_query ($query);
echo " ";
while ($row = Mysql_fetch_assoc ($result)) {
echo " ". $row->no. ";
echo " ". $row->ch. ";
echo " ". $row->f. ";
}
echo " ";
Mysql_close ();
?>
conn.php and databases are fine. The file format is utf-8.
Tips in the browser:
The XML page could not be displayed.
You cannot view XML input using a style sheet. Please correct the error and click the Refresh button, or try again later.
--------------------------------------------
The top level of the document is invalid. An error occurred while processing the resource ' http://localhost/getXML.php '. Line 1th, Location: 1
?
^
------Solution--------------------
Mysql_fetch_assoc or Mysql_fetch_object?
The reason why an XML page cannot be displayed is because you have turned off the error message and you have used Internet Explorer.
------Solution--------------------
The first one is the above hint?
Then you have to look at the code of your page or something wrong.
But XML is really annoying, I have tried to output XML actually in a few browsers some of the normal is not normal.
------Solution--------------------
How about a new Firefox?
------Solution--------------------
discuss
I didn't drop Firefox.
Can that code be displayed correctly in your browser?
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.