Recommend this page to a friend! |
![]() ![]() |
Info | ![]() |
![]() ![]() |
Reputation | Support forum (4) | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
![]() ![]() ![]() ![]() | Total: 5,741 | All time: 407 This week: 159![]() |
Version | License | Categories | ||||
csv2db 1.0.0 | GNU General Publi... | PHP 5, Databases, Files and Folders |
Description | Author | ||||||||||||||||||||||
This package can be used to import data stored in CSV files into a database. |
|
/* * * 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. |
![]() |
File | Role | Description |
---|---|---|
![]() |
Data | Configuration data |
![]() |
Class | Csv2Db class |
![]() |
Class | Csv2DbCfg class |
![]() |
Class | Csv2DbInterface class |
![]() ![]() |
Doc. | Read me |
![]() ![]() |
Data | CSV file to testing |
![]() |
Aux. | preload script |
![]() ![]() |
Example | Case of use |
![]() | csv2db-2005-11-01.zip 7KB |
![]() | csv2db-2005-11-01.tar.gz |
![]() | Install with Composer |
Needed packages | ||
Class | Download | Why it is needed | Dependency |
---|---|---|---|
XML 2 Array | ![]() |
To read XML configuration | Required |
CSV managing class | ![]() |
To read CSV file | Required |
SQL databases interface | ![]() |
To write to database (any supported by it) | Required |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
0% |
|
|
User Ratings | ||||||||||||||||||||||||||||||
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.