0

My PHP script is calling MySQL and getting bunch of records. Is there a function/library in PHP that converts SQL database records into XML? Something like myDBRecords.ToXML()

2 Answers 2

1

You probably want something like XML_Serializer. It will take just about any PHP data structure and return you some XML.

Sign up to request clarification or add additional context in comments.

Comments

0

The command line allows to do

shell> mysql --xml -uroot -e "SHOW VARIABLES LIKE 'version%'"

I don't know if is possible replicate this behavior on SELECT statement

More information in:

http://dev.mysql.com/doc/refman/5.0/en/mysql-command-options.html#option_mysql_xml

Other way to do is using a custom class, an example:

http://px.sklar.com/code.html/id=229

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.