flock or database

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

Threaded View

I have written a simple guestbook in php which writes the contents in a
file while using flock. But I have read that this is not always save.

So some people suggested to use a database instead. But if I use mysql,
then my customers have to pay more for the webspace. Actually, I would
prefer to use a simple database like dbm
(http://www.php.net/manual/de/ref.dbm.php ) and write the information in
a local file.

Under http://www.php.net/manual/de/ref.dbm.php in the last not of the
User Contributed Notes some says that the return codes are nadly
documentated or wrong.

Is dbm a save way to give several scripts/processes at the same time
the ability to read/write from the same file. Or are there maybe others
which php programmers prefer. But remember I want to write the data to
a file and not to database service...

Thanks a lot...

Re: flock or database

hakim wrote:
Quoted text here. Click to load it

It is not safe on Windows.  But you are not going to host your
guestbook on a Windows machine, are you?

Quoted text here. Click to load it

But then you'd have to talk your hosting company into enabling dbm
support.  Would they go along with that for free?  


Re: flock or database

NC schrieb:
Quoted text here. Click to load it
No it's a debian box...

Quoted text here. Click to load it

That's true. But are there some nice file - database solutions other
then dbm, which don't need to be compiled into php??

I have looked for sqlite, but this seems to be experimental...


Site Timeline