Exporting from MySQL to CSV using PHP

Soldato
Joined
28 Sep 2008
Posts
14,167
Location
Britain
Ok, so I've got this working, kind of.

On the website, enquiries that are made are stored in a MySQL database.

This is:

  • id
  • name
  • telephone
  • email
  • address

I've also set up a button that when clicked, allows admins to download a CSV file of this database containing the above information. The problem is, the address only shows the first line.

The submission form has a textarea for the address and people would generally enter the address as:

123 Fake Street
MyTown
PO35 8CO

That appears in phpMyAdmin fine too.

Basically, how can I get the whole output of the address cell into CSV format?

Ta
 
Back
Top Bottom