470,833 Members | 1,722 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,833 developers. It's quick & easy.

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

May 10 '06 #1
4 2015
mysql is the best solution, I thinks in this way.
my choice certainly would be mysql

[]'s

May 10 '06 #2
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.

May 10 '06 #3
On Wed, 10 May 2006 14:48:43 -0700, squash wrote:
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.


or use explode("delimited", $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

May 11 '06 #4
On Thu, 11 May 2006 11:02:38 +0000, Andy Jeffries wrote:
On Wed, 10 May 2006 14:48:43 -0700, squash wrote:
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.


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


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

May 11 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Christopher Boomer | last post: by
11 posts views Thread by Nicolas Girard | last post: by
699 posts views Thread by mike420 | last post: by
7 posts views Thread by gsoftwares | last post: by
2 posts views Thread by Dhanvi | last post: by
11 posts views Thread by reciprocity85 | last post: by
2 posts views Thread by Peter Steiner | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.