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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.