Hi Friends,

I just want to output the xml using php and mysql. Like If i have data in jan month and feb. I wanted to display that in xml sheet. How to go about this please help me.


Regards
Raghu

Recommended Answers

All 4 Replies

// create the XML data 
$xmlData = CreateSomeXMLFromSQL();

// tell the browser its XML
header("content-type: text/xml");

echo $xmlData;
// create the XML data 
$xmlData = CreateSomeXMLFromSQL();

// tell the browser its XML
header("content-type: text/xml");

echo $xmlData;

sorry i am very much new how to create xml from sql() pls explain me or if you have examples please forward me

XML is a method of writing a document, not a template document that you just insert values and then dislay.

in this regard, you need to write your own XML.

MySQL is the database and SQL is the language for querying (instructing, commanding) the database to do something. Depending on which one you are talking about, these are for data storage and retrieval. They have nothing to do with XML.

To create your own XML means you need to take the data and format it in the XML way.

Displaying it as XML in the web browser means sending the php header() before printing the text.

I think you need to read more about what is XML first http://www.w3schools.com/xml/default.asp

Then write your own XML, storing it in a php variable such as $xmlData and then finally output it using the code provided previously.

thanks a lot for your help and quick reply ....

XML is a method of writing a document, not a template document that you just insert values and then dislay.

in this regard, you need to write your own XML.

MySQL is the database and SQL is the language for querying (instructing, commanding) the database to do something. Depending on which one you are talking about, these are for data storage and retrieval. They have nothing to do with XML.

To create your own XML means you need to take the data and format it in the XML way.

Displaying it as XML in the web browser means sending the php header() before printing the text.

I think you need to read more about what is XML first http://www.w3schools.com/xml/default.asp

Then write your own XML, storing it in a php variable such as $xmlData and then finally output it using the code provided previously.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.