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.
Data can be imported from MySQL into a Microsoft Excel spreadsheet by using the Import MySQL Data option after selecting either a table, view, or procedure to import. First of all, you do the first 6 steps describe above in "Edit MySQL Data in Excel" then select your table which you want to import.
To create a .CSV file with syntax suitable for EXCEL you can use basic SQL:
SELECT * FROM mytable
INTO OUTFILE '/mytable.csv'
FIELDS ESCAPED BY '""'
TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\r\n';
See the manual here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With