Jump to content

PHP FOR XML


jonniejoejonson

Recommended Posts

1/ If I have a persons details stored in a mysql database... to get it into xml do I need to use a php sql statement to get the data and then print the result out into an xml format?

 

2/ Why would i ever use xml?... is it simply becuase the data is then available in a structure that other aplications/sites can understiand?

 

thanks to any responders.

Link to comment
https://forums.phpfreaks.com/topic/159041-php-for-xml/
Share on other sites

1: Yes you still need to execute sql queries to get your data out of your database. From there you'll need to format it into xml (many ways to do this) send the appropriate headers and then yes, echo it.

 

2: XML is a great way to move data from one interface to another. eg; At the moment I'm writting a fairly ajax intensive intranet based website. I use jQuery on the client which makes http requests to the server, the server then gathers the data from the database based on the request and sends it back to jQuery as xml. I then use jQuery to parse the xml and place it into the appropriate places within the screen.

Link to comment
https://forums.phpfreaks.com/topic/159041-php-for-xml/#findComment-838867
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.