Page 1 of 1

FlatFile script

Posted: Sat Mar 04, 2006 1:13 am
by Smackie
Alright im a newbie here im only on a friends username because he is outta town and he told me if i need help in php to come to this website and that his name is already logged on so i thought i would come on here and since i didnt know flatfile databases i thought i would come and ask um well...

Im making a site where it will show how many users are on a fleet (its for a submarine game i play we have a orginization) and well i need a flat file script that will hold the Rank and the Username and also have a page where only like 2 people can access the add or delete page 8O :? im not really sure on how it is done even tho i havent did much with php or even flat file i usually work with javascripts and flash but the people that run the site wants this in php so im going to do it in php so please help me thank you so much for the help in advanced.

Posted: Sat Mar 04, 2006 1:45 am
by Christopher
First, you should create your own account -- it's free.

For a flat file database you will need to write your own reade/writer, though there is probably a script around to do that. If you use the file() function to read the file into an array, you can look through and explode() on whatever separator you are using. To write, reverse the process.

But perhaps you should take a look as PHP's SQLite database extension. It uses regular files for databases but you can query using SQL just like a regular database.

Posted: Sat Mar 04, 2006 9:36 am
by neophyte
I second the sql lite suggestions. Why rewrite what's already been done. Sqllite is exactly that ... a flat file system that comes with PHP.

Posted: Sat Mar 04, 2006 9:38 am
by Smackie
um like i said he told me to use his name and i dont wanna just come here just for this and not come back again so why should i make a username and not come back?

and um i understood not even half of that sir im really sorry but like i said im a newbie at this i only work with javascript and flash...

Posted: Sat Mar 04, 2006 9:47 am
by neophyte
Sql lite is a flat file system that can be used like a database. You can insert, select, update and so forth.

http://us2.php.net/manual/en/ref.sqlite.php

Even if you don't use it, you'll end up writing functions that do the same.