PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Martin Grund   CSV file db   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example PHP script
Class: CSV file db
Manipulation and navigation of CSV files
Author: By
Last change: Added a data manipulation section
Date: 20 years ago
Size: 1,205 bytes


Class file image Download

//Create new recordset
$rec = new file_db;
//Define the file to read
$rec->filename = "./example.csv";
//Open File and load first recordset
//Now first recordset can be displayed
echo $rec->record["name"]."-".$rec->record["city"]."<br>";
//If you want to display all use something like this
while (!$rec->EOF)
//You can also start with the last recordset
    while (!
//Now lets manipulate...
    //First select the recordset
//Echo some contents
echo $rec->record["name"];
//Change some content
$rec->record["name"] = "Kai-Uwe";
//Update the selection
//Now add a new recordset
//Now add the content
//At last you have to update the db