473,372 Members | 1,016 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,372 software developers and data experts.

Looking for a FlatFile database driver for PHP

Hi group,

Introduction:
I need access to database-functionality for a project.
The problem is I cannot be sure that a database exists on all places where I
need to run the code.
I can only expect PHP to be installed on all the intranets where the
software runs.

So to mimic some databasefunctionality I first thought to use plain files to
store the data. Or maybe write away my datastructures serialized.
That is a bit cumbersome, but can be done.
Things would be nicer for if I could use real SQL.

My question:
So I wondered if there is some way for me to use real SQL-statements on a
flatfile. If that is possible I would really safe me a lot of trouble.
In that way I can use real SQL and do not expect my customers to have to
install mySQL or Postgres.

I hope I make sense. :-)

TIA,
Erwin Moller
Jul 17 '05 #1
8 3507
Erwin Moller wrote:
I need access to database-functionality for a project.
The problem is I cannot be sure that a database exists on all places where I
need to run the code.
I can only expect PHP to be installed on all the intranets where the
software runs.

So I wondered if there is some way for me to use real SQL-statements on a
flatfile. If that is possible I would really safe me a lot of trouble.
In that way I can use real SQL and do not expect my customers to have to
install mySQL or Postgres.


Have a look at this:
http://sourceforge.net/projects/fsql

Now sure how well it works since I've never tried. The README file has
some documentation about what is supported and how to use it.

--
Justin Koivisto - sp**@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.

Jul 17 '05 #2
With total disregard for any kind of safety measures Erwin Moller
<si******************************************@spam yourself.com>
leapt forth and uttered:
Hi group,

Introduction:
I need access to database-functionality for a project.
The problem is I cannot be sure that a database exists on all
places where I need to run the code.
I can only expect PHP to be installed on all the intranets where
the software runs.

So to mimic some databasefunctionality I first thought to use
plain files to store the data. Or maybe write away my
datastructures serialized. That is a bit cumbersome, but can be
done. Things would be nicer for if I could use real SQL.

My question:
So I wondered if there is some way for me to use real
SQL-statements on a flatfile. If that is possible I would
really safe me a lot of trouble. In that way I can use real SQL
and do not expect my customers to have to install mySQL or
Postgres.

I hope I make sense. :-)

TIA,
Erwin Moller


Have you looked into PEAR::DBA @ http://pear.php.com/DBA ?

It's a file-based database system that uses either the Berkeley DB
driver extention (if available) or a flatfile-based alternative.
Berkeley DB's are a very stable form of file storage, read the
blurb for yourself at http://www.sleepycat.com/

Also there is PEAR::DBA_Relational
(http://pear.php.net/DBA_Relational) which enables you to use the
above system in a relational database fashion. Complete with stuff
like query joins and other handy things.

--
There is no signature.....
Jul 17 '05 #3
Erwin Moller <si******************************************@spam yourself.com> wrote in message news:<3f*********************@news.xs4all.nl>...

<snip>
My question:
So I wondered if there is some way for me to use real SQL-statements on a
flatfile. If that is possible I would really safe me a lot of trouble.
In that way I can use real SQL and do not expect my customers to have to
install mySQL or Postgres.


1. "Text DB" http://www.c-worker.ch/txtdbapi/index_eng.php
2. SQLite http://in.php.net/sqlite (if you're provided)

--
"There are two kinds of people, those who do the work and those who
take the credit. Try to be in the first group; there is less
competition there." -- Indira Gandhi
Email: rrjanbiah-at-Y!com
Jul 17 '05 #4
Hello,
My question:
So I wondered if there is some way for me to use real SQL-statements on a
flatfile. If that is possible I would really safe me a lot of trouble.
In that way I can use real SQL and do not expect my customers to have to
install mySQL or Postgres.


You may want to take a look at this solution written in pure PHP as you
want. It provides support to execute the usual SQL queries SELECT,
UPDATE, INSERT and DELETE, as were CREATE and DROP tables. It is
probably not very fast but is what you asked for.

Class: Perfect Database File
http://www.phpclasses.org/pdbf

--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/

Jul 17 '05 #5
Hi all,

Thanks a lot for all your suggestions!
I was afraid to get negative responses or none at all (The worst).
:-)

I am looking into it right now.
Thanks!

Regards,
Erwin Moller
Jul 17 '05 #6
R. Rajesh Jeba Anbiah wrote:
Erwin Moller
<snip>
My question:
So I wondered if there is some way for me to use real SQL-statements on a
flatfile. If that is possible I would really safe me a lot of trouble.
In that way I can use real SQL and do not expect my customers to have to
install mySQL or Postgres.


1. "Text DB" http://www.c-worker.ch/txtdbapi/index_eng.php
2. SQLite http://in.php.net/sqlite (if you're provided)

Thanks Rajesh,

I found number 1 extremely usefull and userfriendly.

"Text DB" http://www.c-worker.ch/txtdbapi/index_eng.php

Regards,
Erwin
Jul 17 '05 #7
Since "Text DB" is extremely slow, I would reccomend taking a look at
txtSQL (http://txtsql.sf.net) support for a subset of SQL is on the
way. The plus is that it's much quicker than Text DB
(http://chibiguy.dotgeek.org/benchmark.htm)

Jul 17 '05 #8
FarazAli wrote:
Since "Text DB" is extremely slow, I would reccomend taking a look at
txtSQL (http://txtsql.sf.net) support for a subset of SQL is on the
way. The plus is that it's much quicker than Text DB
(http://chibiguy.dotgeek.org/benchmark.htm)


Nice work. But, looks like that we need to go for another
wrapper--incase if we did code with direct queries
<http://txtsql.sourceforge.net/content/docs/index.php?f=29>

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

Jul 17 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: mdh | last post by:
I am trying to learn the basics of MVC applications using a Tomcat infrastructure. I'm starting by building a simple application with: * a login.jsp page for a basic login form with a action...
6
by: mark4asp | last post by:
Hello, Is there a simple way to check whether a database driver is available on a remote server? I only have ftp access so I can only run ASP scripts. An ASP application on a host has...
6
by: Zenobia | last post by:
Last Friday (or early Saturday) the database driver seemed to vanish from my web-site. On Monday, it reappeared. The host was told about the missing driver on Saturday but claims to have done...
3
by: Rakesh | last post by:
Hi, I want to get connection to a DB2 database using the driver COM.ibm.db2.jdbc.DB2XADataSource. I have also included 'db2java.zip' in the classpath. However I am getting the exception ...
1
by: Thomas | last post by:
Hello out there! Is there anybody who can help me? I generated some datas in three flatfiles on our z/OS-Mainframe. But these datas should be used in a UDB-database on a server. Has anybody an...
13
by: TS | last post by:
Say i have a class car with properties: Color, Make, Model, Year, DriverID And a Driver class with properties: DriverID, Name The driverID PRIVATE property is the id of the driver from say a...
7
by: Bill Nguyen | last post by:
I have this connection string using ODBC DSN Dim FactorJaco As String = "dsn=jaco;catalog=factor;uid=user;pwd=passord" This requires an ODBC DSN (jaco) at every client PC. I need to use DSN-less...
9
by: Peter Duniho | last post by:
Is there a straightfoward API in .NET that allows for inspection of a database? That is, to look at the structure of the database, without knowing anything in advance about it? For example,...
4
by: Man4ish | last post by:
Hi, How can i connect to database(flatfile) on unix server to access the data on local machine(windows/linux) in C++? Thanks in advance. Regards Manish
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.