S1syphus
S1syphus

Reputation: 1441

Whats the best way to generate a XML output of a MySQL database using PHP

A bit on my requirements, at the moment i'm passing on a search string from a Cocoa app to a PHP script which queries the database, and then generates an XML output for Cocoa again.

The only bit I am having issues with now is generating the XML output from the db query.

At the moment, i'm trying to loop through the results and output them, however I am having issues, I can create the XML file but it doesn't get the results from the loop.

I can post my code if needed, but I'm sure somebody will have a more effective method.

Upvotes: 2

Views: 441

Answers (1)

Artefacto
Artefacto

Reputation: 97845

Do not use PHP at all for the XML generation. MySQL can do that. If the XML in a specific format you can use XSLT, but at that point it may be easier to use PHP instead.

Upvotes: 2

Related Questions