Get MySQL database output via PHP to XML

前端 未结 5 952
失恋的感觉
失恋的感觉 2020-11-27 17:37

I have a MySQL database on my website, and I would like to know how I could get an XML output via PHP of the following columns in the table:

  1. udid
  2. coun
5条回答
  •  悲&欢浪女
    2020-11-27 18:13

     $value) {
        echo "<$key>$value";
      }
    }
    
    ?>
    

    This code snippet should give you a good start. But without the wanted XML structure, it's hard to do better.

    However I'm not sure PHP is the right solution for this task. Many tools, like phpmyadmin for example, can output mysql data in XML format.

提交回复
热议问题