Stack Exchange
Stack Overflow
Questions
Tags
Users
About
Stack Overflow
Public
Questions
Tags
Users
About
How to print a MySQL query results as XML in PHP?
Asked
May 05 '11 at 10:15
Active
May 05 '11 at 10:45
Viewed
1,279 times
0
I would like to output as XML, the results of a MySQL query.
Could you help me please?
php
mysql
xml
edited May 05 '11 at 10:32
Maxime Pacary
22,336
11
85
113
asked May 05 '11 at 10:15
hansgiller
973
4
12
15
1 Answers
1
0
For MySQL => PHP : use raw PHP functions like
mysql_query()
,
mysql_fetch_assoc()
etc., or PDO, or an ORM...
For PHP array => XML, here is an example:
How to convert array to SimpleXML
. And another good one:
http://snipt.net/robertbanh/php-array-to-xml/
edited May 23 '17 at 11:55
Community
1
1
answered May 05 '11 at 10:22
Maxime Pacary
22,336
11
85
113