xml, php and mysql question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rizen
Forum Newbie
Posts: 3
Joined: Thu Jun 24, 2004 3:59 pm

xml, php and mysql question

Post by rizen »

I have a mysql database. I am able to create a a dynamic table that's populated with the records from that table using PHP.

What I want to do is, write php code that will output the data from the mysql database into an xml format file.

What's steps should I take to accomplish this?

THnaks
User avatar
ol4pr0
Forum Regular
Posts: 926
Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador

Post by ol4pr0 »

I believe on the http://www.zend.com there are a couple of tutorials on how to write an xml file..
inserting that data into the xml i guess you can do that by just adding the $row['datafield'] between the nodes.
User avatar
PrObLeM
Forum Contributor
Posts: 418
Joined: Sun Mar 07, 2004 2:30 pm
Location: Mesa, AZ
Contact:

Post by PrObLeM »

dont forget to use
header('Content-type: text/xml');
or it wont work :D
rizen
Forum Newbie
Posts: 3
Joined: Thu Jun 24, 2004 3:59 pm

Post by rizen »

Where do I put that line?

"header('Content-type: text/xml'); "
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

before all echos, html, any any other character output (including whitespace)
Post Reply