Going With a Flat-File DB for a Simple Comment Form

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

    Going With a Flat-File DB for a Simple Comment Form

    Hello All,

    I'm trying to make a comment section on my website. However, I don't
    want to set up a MYSQL database to do so because I want to make it
    really simple, just a form that asks for their name and comment. Is
    there any way I can store this information in a flat file and then use
    PHP to display the comments and names? I was thinking that XML might be
    good for this, but I don't know any XML.

    Thanks,
    Jacob

  • brun0

    #2
    Re: Going With a Flat-File DB for a Simple Comment Form

    mysql is the best solution, I thinks in this way.
    my choice certainly would be mysql

    []'s

    Comment

    • squash@peoriadesignweb.com

      #3
      Re: Going With a Flat-File DB for a Simple Comment Form

      sure you can use a flatfile. just pick a good delimeter to seperate the
      names and comments. Then read in the file using file () and split each
      line into an array using preg_split ( '/delimeter'/ ...
      then write out the comments. forget mysql for such a simple thing.

      Comment

      • Andy Jeffries

        #4
        Re: Going With a Flat-File DB for a Simple Comment Form

        On Wed, 10 May 2006 14:48:43 -0700, squash wrote:[color=blue]
        > sure you can use a flatfile. just pick a good delimeter to seperate the
        > names and comments. Then read in the file using file () and split each
        > line into an array using preg_split ( '/delimeter'/ ... then write out the
        > comments. forget mysql for such a simple thing.[/color]

        or use explode("delimi ted", $string) which will be quicker than preg_split.

        Cheers,


        Andy

        --
        Andy Jeffries MBCS CITP ZCE | gPHPEdit Lead Developer
        http://www.gphpedit.org | PHP editor for Gnome 2
        http://www.andyjeffries.co.uk | Personal site and photos

        Comment

        • Andy Jeffries

          #5
          Re: Going With a Flat-File DB for a Simple Comment Form

          On Thu, 11 May 2006 11:02:38 +0000, Andy Jeffries wrote:[color=blue]
          > On Wed, 10 May 2006 14:48:43 -0700, squash wrote:[color=green]
          >> sure you can use a flatfile. just pick a good delimeter to seperate the
          >> names and comments. Then read in the file using file () and split each
          >> line into an array using preg_split ( '/delimeter'/ ... then write out
          >> the comments. forget mysql for such a simple thing.[/color]
          >
          > or use explode("delimi ted", $string) which will be quicker than
          > preg_split.[/color]

          And wouldn't have the downsides of having to ensure you avoid regular
          expression special characters (for example, not that you would, but you'd
          have an issue if you picked . as your separator).

          Cheers,


          Andy

          --
          Andy Jeffries MBCS CITP ZCE | gPHPEdit Lead Developer
          http://www.gphpedit.org | PHP editor for Gnome 2
          http://www.andyjeffries.co.uk | Personal site and photos

          Comment

          Working...