jonniejoejonson Posted May 21, 2009 Share Posted May 21, 2009 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. Quote Link to comment Share on other sites More sharing options...
trq Posted May 21, 2009 Share Posted May 21, 2009 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.