i want to Export MYSQL data into Excel/CSV via php. so that i can use my database later or someone can use and understand it.
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
All thanks to Linmic and @Kaszoni Ferencz for sharing this. Nothing more then updated to PDO as mysql functions no more available.
Add Export button:
Add id to table:
Add script at below of body:
I think this is what you are looking for
You can create your own file by checking this address: http://www.programmingfacts.com/export-mysql-data-into-excelcsv-via-php/
I can't add working code in here sth is wrong =/
but make all \\t to \t and all \\n to \n
If you want to use PHP, consider the fputcsv function. But you can export from MySQL to text format without PHP. See this page on using mysqldump.
To create a .CSV file with syntax suitable for EXCEL you can use basic SQL:
See the manual here.