flock or database

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • hakim

    flock or database

    Hi,

    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...

  • NC

    #2
    Re: flock or database

    hakim wrote:[color=blue]
    >
    > 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.[/color]

    It is not safe on Windows. But you are not going to host your
    guestbook on a Windows machine, are you?
    [color=blue]
    > 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.[/color]

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

    Cheers,
    NC

    Comment

    • hakim

      #3
      Re: flock or database

      NC schrieb:[color=blue]
      > It is not safe on Windows. But you are not going to host your
      > guestbook on a Windows machine, are you?
      >[/color]
      No it's a debian box...
      [color=blue]
      > But then you'd have to talk your hosting company into enabling dbm
      > support. Would they go along with that for free?
      >[/color]

      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...

      hakim

      Comment

      Working...