FlatFile script

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Smackie
Forum Contributor
Posts: 302
Joined: Sat Jan 29, 2005 2:33 pm

FlatFile script

Post 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.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post 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.
(#10850)
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Post 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.
Smackie
Forum Contributor
Posts: 302
Joined: Sat Jan 29, 2005 2:33 pm

Post 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...
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

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