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
Try the fputcsv function. Also the MySql CE (5.2) Workbench is a good tool for both exporting the data and getting a picture of the database as a diagram.
I have searched so much for this on google, but the only code that is simple and IS WORKING is the one below. Create a downloadxls.php file (or name it whatever.php), copy/paste the code below, complete the host, username, password, database and table sections at the beginning of the code, and there you have a very nice working code. Then load the php file in your browser, and the xls file will be downloaded. I've tried it, and I'm using it.
All the best :)