Posts Tagged "csv"

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…

Read More