Posts Tagged "export"

How to export the data from MySQL into a XML file with PHP?

There are a couple of ways to export data from MySQL to a XML file. This post looks at how to export the data from MySQL into a XML file with PHP. The example code below uses the raw mysql_* functions but it should be easy enough to substitute a database library’s functions instead. It also writes the data out line by line to the XML file whereas you could buffer the whole file in memory and write it out…

Like to share it
Read More

How to export the data from MySQL into a CSV file with PHP including a header row?

There are a couple of ways to export data from MySQL to a CSV file but some of them never supports adding a header row to the CSV which contains the column names. This post looks at how to export the data from MySQL into a CSV file with PHP including a header row. The example code below uses the raw mysql_* functions but it should be easy enough to substitute a database library’s functions instead. It also writes the…

Like to share it
Read More