PHP Classes

write in to csv: get data from db and put in csv

Recommend this page to a friend!
  All requests RSS feed  >  write in to csv  >  Request new recommendation  >  A request is featured when there is no good recommended package on the site when it is posted. Featured requests  >  No recommendations No recommendations  

write in to csv

Edit

Picture of ramesh by ramesh - 10 years ago (2015-03-01)

get data from db and put in csv

This request is clear and relevant.
This request is not clear or is not relevant.

+1

get data from db and put in csv

  • 1 Clarification request
  • 1. Picture of Manuel Lemos by Manuel Lemos - 10 years ago (2015-03-04) Reply

    What database are you using? Is it MySQL or some other database?

    Ask clarification

    1 Recommendation

    MySQL Database Library: Access MySQL databases and manipulate files

    This class can access MySQL databases and execute common queries. Currently it can:

    - Connect to a given MySQL host and access a given database
    - List all tables in the accessible databases
    - Get the columns of a given table
    - Compose and execute SELECT queries to a given table getting specific fields by a given sorting order returning the results into a single array
    - Search for given table records that match given conditions
    - Insert table records with given field values
    - Update table records with given field values and conditions
    - Delete table records that match a condition
    - Create table records for a new user with a password
    - Authenticate a given user with a password in the users table
    - Change a given user password in the users table
    - Update or delete given user records in the users table
    - Read the text contents of files in the format CSV, PDF or Microsoft Word
    - Write plain text or CSV files
    - Rename or delete files
    - Get the list of files from a directory
    - Etc..
    This recommendation solves the problem.
    This recommendation does not solve the problem.

    +1

    Picture of Justin Eldracher by Justin Eldracher package author package author Reputation 160 - 9 years ago (2015-06-22) Comment

    My MySQL database class has a write() method that outputs a matrix to csv. (All the SELECT statements in my class return a matrix.) So you could use it like so:

    include "DB.php"; $db = new DB("my_table"); $db->write("output_file_name.csv", $db->all());

    Including a third parameter will let you save in tab or any other form of delimited format.


    Recommend package
    : 
    :