Pure Php Flat-File Databases?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I've writing my own flat file database.. well table-based pure php
code, PhpSimpleDb but I was looking into some bench marking so was
wonder if anyone knew any other flat-file php db's out there.

Gladius DB

ps. http://code.google.com/p/phpsimpledb/ is what I have working right

Re: Pure Php Flat-File Databases?

Quoted text here. Click to load it

Any reason to compete with SQLite? I found that is was enabled on most  
Rik Wasmus
...spamrun finished

Re: Pure Php Flat-File Databases?

Well, SQLite uses SQL, I was just looking to to use pure php to query
rather then SQL. Which is why I considered writing my own. I am in no
way trying to compete with SQLite in the sense of a full fledge
database, just something simple for php using php.

Sample MySQL
$link  = mysql_connect('localhost', 'username', 'password');
$table = mysql_select_db('sampledb');
$query = mysql_query('SELECT * t1 WHERE c LIKE "%thousand%"');
$entry = mysql_fetch_assoc($query);

Sample SimpleDb
$t     = new t1('data');
$rows  = $t->filter('stristr(c, "thousand")')->query();
$idx   = array_shift($rows);
$entry = $t->fetch($idx);

Quoted text here. Click to load it

Re: Pure Php Flat-File Databases?

Gorilla3D wrote:
Quoted text here. Click to load it

I think you'll find SQLLite or MySQL will outperform anything you write
in PHP, unless it's for very small files.

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Re: Pure Php Flat-File Databases?

Gorilla3D schreef:
Quoted text here. Click to load it


I used a few in the past, with different results.
In these days almost every server running PHP also runs at least mySQL,
or if you are really lucky: Postgresql.

Here is a link to a reasonably wellknown flatfile engine: ffdb (flat
file db):
http://sourceforge.net/projects/ffdb-php /

You can use that one for benchmarking.

I don't want to be negative, but the flatfile approach is needed less
and less. So unless you are doing this for pure fun, I don't expect many
will need it.

Good luck!

Erwin Moller

PS: I wanted to give you more links, but in all honesty, I plainly
forgot the names of the other flat file SQL engines I used. :-)
I know there a few more out there.

Re: Pure Php Flat-File Databases?

Quoted text here. Click to load it

By the way i use SQLite on my usb-sticks, where i store my sites as
portable back-ups, run hp from stick from my customized apache-lite,
its really handy.. I use to used flat files but, i think SQLite is the

Site Timeline