Discussion:
How do I convert a database into XML?
(too old to reply)
Gabe the Animator
2009-03-28 18:51:08 UTC
Permalink
I have a PHP webpage that lets users upload pictures and accompanying text to a
MySQL database. I want to be able to convert the data & images saved on the
database to XML so that I can incorporate them into Flash. How would I be able
to do this so that it gets continually updated? It can't just be a static XML
page. Thanks!!
Lawrence *Adobe Community Expert*
2009-03-28 20:30:06 UTC
Permalink
Hi Gabe,

Let me preface this by saying I'm not a PHP developer, I'm a CF guy, so I
don't know the exact details, but here's how I'd do it in CF.

You keep the data in MySQL and do all the updating there, where it should
be, but you right a script that whenever the database is updated you write
the data you need to an XML file and overwrite the current one. This way the
XML file will remain in synch with your database. This is assuming you are
updating your database via an Admin page and not entering the data directly.
If you are entering the data directly, which I hope you're not, You'd have
to manually access and execute the page that writes the XML file. Writing
the results of a query to an XML file is a piece of cake in CF, I'm sure
there is a corresponding function in PHP.
--
Lawrence *Adobe Community Expert*
Cartweaver.com
Complete Shopping Cart Application for
Dreamweaver, available in ASP, PHP and CF
Post by Gabe the Animator
I have a PHP webpage that lets users upload pictures and accompanying text to a
MySQL database. I want to be able to convert the data & images saved on the
database to XML so that I can incorporate them into Flash. How would I be able
to do this so that it gets continually updated? It can't just be a static XML
page. Thanks!!
David Powers
2009-03-28 23:06:32 UTC
Permalink
Writing the results of a query to an XML file
is a piece of cake in CF, I'm sure there is a corresponding function in
PHP.
Creating XML from a database result is quite easy in PHP. Details here:

http://labs.adobe.com/technologies/spry/samples/utils/query2xml.html
--
David Powers
Adobe Community Expert, Dreamweaver
http://foundationphp.com
Art
2009-03-29 21:11:38 UTC
Permalink
Yep, that's where I'd point to.
Post by David Powers
Writing the results of a query to an XML file is a piece of cake in
CF, I'm sure there is a corresponding function in PHP.
http://labs.adobe.com/technologies/spry/samples/utils/query2xml.html
Loading...