PHP Classes
Icontem

File: readmeFirst.txt


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Michal Palma  >  CSV to SQL database converter  >  readmeFirst.txt  
File: readmeFirst.txt
Role: Documentation
Content type: text/plain
Description: Read me
Class: CSV to SQL database converter
Import data from a CSV file into a database
 

Contents

Class file image Download
/*
*
* Class converts CSV content to DB table
* @package Csv2Db
* @date 2005-08-08
*/

*Motivation
- convert CSV files as table to database
- as flexible as possible
- easily and separately configured idealy by XML file


*Dependencies:
- PHP 5 needed
- Class DbControl needed - You can find it at www.phpclasses.org in archiv of Author Michal Palma
- Class Xml2Array needed - You can find it at www.phpclasses.org in archiv of Author Michal Palma
- Class Csv needed - You can find it at www.phpclasses.org in archiv of Author Michal Palma

*Install
- fulfil dependencies higher
- Check all includes in _preload.php
- configure database connection and other in config.xml in DbControl package for task csv2db. (Actual DbControl/config.xml does contain it, You must only reconfigure connection parameters)
- try "___case_of_use.php"
- if You want to parse big table, you will must specify higher "max_execution_time" for longer script run in Csv2Db/config.xml. This attributes are exclusive for concrete table.


*How to use it?
 First you must create an instance of Csv2Db class with essential parameters.
 - For example: $instance = new Csv2Db("test.csv", $separator = ";", $charset = "utf8", $useconfig = true).
 Then you must only call $instance->dbWrite().
 If there is some problem, library will throw standard PHP5 exception.
 If not, You can call $instance->getRowsCount() for get how much rows did file contents.
 Thanks to DbControl class you can use any from supported Database platforms (in v1.3: MySQL, MSSQL, ODBC). You can choose between them by change attributtes in DbControl/config.xml whithout any change of code.
All converting process is closed into transaction.

*Projected improvements on next versions
- performance optimalization


Some cases of use are defined in ___case_of_use.php.

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products