# Exporting MySQL table to Excel file?

**URL:** <https://forum.kirupa.com/t/exporting-mysql-table-to-excel-file/188394>\
**Category:** programming\
**Created:** [May 7, 2006, 10:27am UTC](https://forum.kirupa.com/t/exporting-mysql-table-to-excel-file/188394 "2006-05-07T10:27:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ya3](https://avatars.discourse-cdn.com/v4/letter/y/e95f7d/32.png) [@ya3](https://forum.kirupa.com/u/ya3)\
**Post date:** [May 7, 2006, 10:27am UTC](https://forum.kirupa.com/t/exporting-mysql-table-to-excel-file/188394/1 "2006-05-07T10:27:00Z")

</div>

Say I had a table with 4 fields - name, surname, email, phone - and I need an easy way for the user to download the table as an Excel spreadsheet (CSV format?), how would I do it?

I basically just need:  
[FONT=Courier New]name1 surname1 email1 phone1  
name2 surname2 email2 phone2  
name3 surname3 email3 phone3

[FONT=Verdana]Obviously, they need to be arranged into columns in Excel, with each value inside a cell.

What’s the easiest way to do this?

Thanks in advance 🙂  
[/FONT][/FONT]
