Hello friends, today I will show you how to export SQL result to XML file in PHP. When we are working with any SQL result set it gives us one or many rows. We use this result in our application. But when you fetch rows using sql but instead of showing result if you need to store the result set for future use or any other reason, you may use xml file to store the result set. So I build a code to export sql result to xml in PHP.

Here I have a table name product. I will fetch all the rows from this table and store them in a xml file. At last this xml file will save to your directory and you will see the xml file output to your browse.



Thats All. If you like my post please share it.

Spread the love
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
How to export SQL result to XML file in PHP
Tagged on:     
  • Richie

    thank you very much