Page 1 of 1

xml, php and mysql question

Posted: Fri Jun 25, 2004 1:43 pm
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

Posted: Fri Jun 25, 2004 2:38 pm
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.

Posted: Fri Jun 25, 2004 3:14 pm
by PrObLeM
dont forget to use
header('Content-type: text/xml');
or it wont work :D

Posted: Fri Jun 25, 2004 3:36 pm
by rizen
Where do I put that line?

"header('Content-type: text/xml'); "

Posted: Fri Jun 25, 2004 3:38 pm
by feyd
before all echos, html, any any other character output (including whitespace)