I use flex+php+mysql reading data show there is a problem! How do you change your look?

Source: Internet
Author: User
I use Flex+php+mysql to read the data show there is a problem! Look at how to change the wording??
Here is the code for bookdao.php:


$link = mysql_connect ("localhost", "* * *", "* * *");

mysql_select_db ("book");

mysql_query ("SET NAMES ' UTF8 '");

/* returns books*/in XML format

$sql = ' SELECT * from books ';

$result = mysql_query ($sql);

echo " ";

echo " \ n ";

while ($row = Mysql_fetch_array ($result)) {

echo " ". $row ["id"]. "";

echo "". $row ["Author"]. "";

echo " ". $row [" title "]."\ n ";

echo " ". $row ["Genre"]. " \ n ";

echo " ". $row ["Price"]. " \ n ";

echo " ". $row ["Publish_date"]. " \ n ";

echo " ". $row ["description"]. " \ n ";

}

echo " \ n ";


Mysql_close ($link);
?>

The result of the display in Mxml is: I will count the results in a simple way because I can't put them on:
How are you doing!
This is the content of the DataGrid display data, the Auhtor tag is also displayed on the page, rather than just show "Hello!" "This content ....
How to ask?

------Optimal Solution--------------------
Htmlspecialchars () put your XML string in and print it out because you didn't use the header to indicate the reason for Content-type.

You direct the header ("Content-type:xml"), and the following code does not change, the browser can print out the tagged XML.
------Other Solutions--------------------
Change the header: header ("Content-type:xml");
------Other Solutions--------------------
How to change it? I have no use for this, do not know how to change? You write an example to see.
------Other Solutions--------------------
I added this header, it didn't work, or withOutput ...
------Other Solutions--------------------
I added this header, it didn't work, or withOutput ...
------Other Solutions--------------------
Do you want to label or not?
------Other Solutions--------------------
Do not label
  • Contact Us

    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.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.