zubrag.com
Free php and cpanel scripts to automate your daily routine

Free PHP Scripts :: Flat File Database Manager

A flat file is a file that contains records. Each record is specified in a single line. Fields from each record may either have a fixed width, or may be delimited by commas (CSV), tube (|), whitespace, tabs, or any other character.

Flat File Database Manager will allow you to manage (update/delete/add) records in your flatfile database.
Note: Currently flat files of fixed field width are not supported.

Features:
  • user defined delimiter (usually pipe, colon, or comma (|:,)
  • customizable presentation of different data types. Following data types supported:
    • LIST - Rendered as list box or combo box.
    • STRING - Rendered as regular input field.
    • LOGICAL - Rendered as check box (flag).
    • TEXT - Rendered as text area.


Flat File Database Manager screenshot

What is in the package?
1) cities.txt - database itself, i.e. file containing data. Sample database.
2) cities.def - data definition file, describes database (how long each field can be, its type, etc). Update it.
3) cities.php - database settings file (delimiter, file names, etc). Update it. See instructions in the flatfile.inc.php. Run this script to manage your db.
4) flatfile.inc.php - flatfile db manager engine. This file should not be updated.

Download Flat File Database Manager


Comments

Flatfile database user October 4, 2007
My flatfile databse is about 500K. Loading on IE took few seconds. Loading on Firefox took about a minute. I wish firefox was faster. Thanks for the script!
PS: please add reporting or data filtering capabilities.
Girish Singh April 4, 2008
I was looking for flat file database to use on website where the host could not support a database.

Another page which I found useful was

http://www.mabaloo.com/Web-Development/Building-a-fully-function-website-but-without-a-DATABASE.html
k.bahadur673 [anti-spam] gmail.com May 3, 2008
its a very good work done by you people
July 21, 2008
Fantastic work guys, this makes things a lot less bulky for me. Just needed flash to load some values and rather than connect to a SQL server, I can get it from a structured txt. Grade A+++
November 6, 2008
What happens if numerous users edit and save the CSV at the same time ? I wonder what would happen if their changes where saved.
February 28, 2009
Great!!! - something that can be customised easy by a PHP newbie - thanks, much appreciated lads ;-) for all your work
March 9, 2009
Very nice script. Is it also possible to add something like a date field. (DATE iso STRING)?
jj March 10, 2009
Interesting approach...
cj [anti-spam] cjluck.com April 12, 2009
I really like this script. I use it to make simple online signup sheets for prayer events.
Damoon April 18, 2009
What of if i want use it for a chatting site or dating site , will it support it????
kkk August 11, 2009
kkkk
Zante September 4, 2009
Needs a way to shift records up and down. Currently the only way to do it is by editing the txt files.
aleks [anti-spam] motor-racing.net September 21, 2009
Hi, Great script, how can i limit the number of row to 7 or 8 with no add or delete of rows.

thanks ak
October 2, 2009
HI. If anyone needs it, this script will make the data in the defined file into a muti-demesinal array

<pre>
<?php
$file = "test.txt";
$config = array();
$config1 = file_get_contents($file);
$config2 = explode("\n",$config1);
//print_r($config2);
?>
<?php
$num;
foreach ($config2 as $i) {
$num++;
}
for ($i=0;$i<$num-1;$i++) {
$config3 = explode(":",$config2[$i]);
//print_r($config3);
?>
<?php
$name = $config3[0];
$value = $config3[1];
$config[$name] = $value;
}
?>

See in action at
http://67.220.215.115/ffdm.php
bundyxc November 28, 2009
"My flatfile databse is about 500K. Loading on IE took few seconds. Loading on Firefox took about a minute. I wish firefox was faster. Thanks for the script!
PS: please add reporting or data filtering capabilities."

Seeing as how this is processed server-side (hence the PHP), I honestly doubt that Firefox is your problem. And if it is your problem, I'm sure that sometime is going wrong for your computer.
fastidioso [anti-spam] altervista.org January 20, 2010
Hello, congratulations for the excellent script!
I wanted to know how can I put in the file flatfile.inc.php function sendmail, to send email to any modification.

examples:
Content-type. */
$Subject = "test\r\n";
$Body = "<a href=\"http://mysite.com/$data_file\">test</a>";
$intestazioni = "MIME-Version: 1.0\r\n";
$intestazioni .= "Content-type: text/html; charset=iso-8859-1\r\n";

$intestazioni .= "To: email@email.it\r\n";
$intestazioni .= "From: email@email.it\r\n";
$intestazioni .= "Cc: email@email.it\r\n";
$intestazioni .= "Bcc: email@email.it\r\n";

// send email
$success = mail($Subject, $Body, $intestazioni);

Thanks
marek February 27, 2010
oh yea, this freakin thing DOESN"T WORK!

Add Comment

!!! Comments posted here will not be answered. If you want to ask a question please post it on the forum.

E-mail or Name: Not required. Email will be protected from spammers

Comment: Please do not post unrelated comments

Anti-spam: Please enter (58ae6e53) into the box