data to be displayed in xml

Reply

Join Date: Nov 2008
Posts: 3
Reputation: raghu6152 is an unknown quantity at this point 
Solved Threads: 0
raghu6152 raghu6152 is offline Offline
Newbie Poster

data to be displayed in xml

 
0
  #1
Apr 20th, 2009
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
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 95
Reputation: jakesee is an unknown quantity at this point 
Solved Threads: 4
jakesee jakesee is offline Offline
Junior Poster in Training

Re: data to be displayed in xml

 
0
  #2
Apr 20th, 2009
  1. // create the XML data
  2. $xmlData = CreateSomeXMLFromSQL();
  3.  
  4. // tell the browser its XML
  5. header("content-type: text/xml");
  6.  
  7. echo $xmlData;
Last edited by jakesee; Apr 20th, 2009 at 7:12 am.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 3
Reputation: raghu6152 is an unknown quantity at this point 
Solved Threads: 0
raghu6152 raghu6152 is offline Offline
Newbie Poster

Re: data to be displayed in xml

 
0
  #3
Apr 20th, 2009
Originally Posted by jakesee View Post
  1. // create the XML data
  2. $xmlData = CreateSomeXMLFromSQL();
  3.  
  4. // tell the browser its XML
  5. header("content-type: text/xml");
  6.  
  7. 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
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 95
Reputation: jakesee is an unknown quantity at this point 
Solved Threads: 4
jakesee jakesee is offline Offline
Junior Poster in Training

Re: data to be displayed in xml

 
0
  #4
Apr 20th, 2009
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.
Last edited by jakesee; Apr 20th, 2009 at 3:25 pm.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 3
Reputation: raghu6152 is an unknown quantity at this point 
Solved Threads: 0
raghu6152 raghu6152 is offline Offline
Newbie Poster

Re: data to be displayed in xml

 
0
  #5
Apr 22nd, 2009
thanks a lot for your help and quick reply ....

Originally Posted by jakesee View Post
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC