I need to select a single row from MySql and get the results as well-formed XML, where the XML tags are the column names. Is there some built-in way to do this, or will I need to manually assemble the XML?
I want something like this:
< id >2< /id > < name >John Smith< /name > < age >34< /age >
Just to clarify and elaborate...
I am inside of a stored procedure in a MySql 5.1.5 database. The procedure needs to execute a simple query like:
SELECT ID, Name, Age FROM People WHERE ID = 5;
And I would like to get the results in XML that I can pass to a calling program.
Any built-in functionality to do this?