What is the best PHP export mysql tab delimited class? #export mysql tab delimited
Edit
by tata respecia - 9 years ago (2015-08-12)
Export MySQL Table to tab delimited file
| I want to export MySQL query results to a tab delimited text file using PHP. |
- 1 Clarification request
1.
by Zhao - 9 years ago (2015-08-19) Reply
You may use fputcsv & fgetcsv to complete your task.
//php.net/manual/en/function.fputcsv.php
//php.net/manual/en/function.fgetcsv.php
Ask clarification
1 Recommendation
This class implements a generic MySQL database access wrapper. It can:
- Connect to a given MySQL server
- Set the connection character set encoding
- Execute arbitrary queries and return the results in arrays
- Retrieve the columns of a table
- Execute UPDATE or INSERT queries from parameters that define the tables, fields, field values and conditions
- Execute multiple INSERT or UPDATE queries at once
- Count the number of rows of a table that match a given condition
- Get the next value of an auto-incremented table field
- Delete table rows that match a given condition
- Export, import, update table using CSV files
- Create table from CSV file
- Export query to CSV file
- Replace values in a given table for defined columns
- Rename, copy, truncate or drop table
- Get database size
- Log queries and errors with backtrace information
| by Dave Smith 7620 - 9 years ago (2015-08-14) Comment
I was torn between a simple class that does the work, however it uses the deprecated mysql extension which is going away, or a more robust class with features you didn't request that is current. This is the more robust class, a full database wrapper that can also manage the export of mysql data to csv files. The biggest advantage is that it supports the mysqli extension. |