radar Posted February 26, 2009 Share Posted February 26, 2009 I've got a database that I've just finished the web application on. It has like 10 tables, 6 of them I need to be able to export either to CSV or to an Access DB file that when the client clicks on the button to export, it opens the dialog for them to save it. I've got no clue how to do either of these things, so anything you can do to help me would be appreciated. Thanks, Radar Link to comment https://forums.phpfreaks.com/topic/147088-export-mysql-to-csv-or-access-db-via-php/ Share on other sites More sharing options...
angelcool Posted February 27, 2009 Share Posted February 27, 2009 You can try this query; although a peer of mine passed it on, I have not tried it myself: SELECT id, name, email INTO OUTFILE '/tmp/records.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY ‘\\’ LINES TERMINATED BY '\n' FROM users WHERE 1 From there, all you have to do is open records.csv and fetch it to the browser. Angel Link to comment https://forums.phpfreaks.com/topic/147088-export-mysql-to-csv-or-access-db-via-php/#findComment-772255 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.