PHP Classes

CSV file db: Manipulation and navigation of CSV files

Recommend this page to a friend!
  Info   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 64%Total: 4,716 All time: 587 This week: 488Up
Version License Categories
csvfiledb 1.0GNU General Publi...Databases, Files and Folders


This class provides simple access to CSV files with the possibility to navigate through the record sets and also to manipulate them.

The access to the record sets is as easy as accessing the record sets of a normal SQL based database.

It just takes the file name of a file with information in the CSV format (Comma Separated Values) the class takes care of the other operations that you may want to perform, like for instance: navigating through the records in the file, updating records, deleting records and adding a new record.

Picture of Martin Grund
Name: Martin Grund <contact>
Classes: 3 packages by
Country: Germany Germany
Age: 42
All time rank: 47127 in Germany Germany
Week rank: 250 Up12 in Germany Germany Up


file_db_class.php 1) What it does This class provides simple access to csv files and let you easy navigate through the tabel. 2) How it works You should only access one of the following functions and variables: Variables: $index // Index in File, DO NOT CHANGE $limiter // The CVS Limiter, usually ";" $filename // The filename of the cvs file $record = array() // The actual record $EOF // True if End of File $BOF // True if Beginning of File Functions: function open_db() - opens file - puts first recordset into record - returns 1 if ok, 0 if not function move_next() - loads the next recordset function move_pref() - loads the previous recordset function move_first() - moves the recordpointer to first recordset and loads it function move_last() - same as above, only last function close() - closes the filehandler function update() - updates the actual recordset function add_new() - adds a new recordset - after add_new the record can be manipulated - in the end just execute update() and the recordset is stored function delete() - deletes current recordset and moves the recordpointer one ahead !!Important!! Please be sure, that you have the rights to read and modify the file.

  Files folder image Files  
File Role Description
Accessible without login Plain text file example.csv Data Example CSV file
Accessible without login Plain text file example.php Example Example PHP script
Plain text file file_db.class.php Class FileDB class File
Accessible without login Plain text file readme.txt Doc. Readme and Documentation file

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:587
This week:488Up
 User Ratings  
 All time