Page 1 of 1
Database or Text file?
Posted: Fri Oct 25, 2002 2:06 pm
by mettlehead
Hi,
I need to create a simple user register sample for a client. I am not to familiar with a database with php. Should I just create a text file to hold the users for now? Is it much faster and easier? Or is it not very safe to do that?
Thanks
Posted: Fri Oct 25, 2002 2:27 pm
by hob_goblin
text files are:
slower (but not that much)
harder to handle
less flexible
risky when it comes to security
if you have the option of using a db, learn how to use it. otherwise, stick with textfiles.
Posted: Sat Oct 26, 2002 1:39 pm
by infolock
aye, text files are the devil when it comes to holding very sensative materials such as username/passwords...
it's REALLY not that hard at ALL using mysql. I posted a really easy way to authenticate a user using mysql, including the steps to create the database, table, and call the values.
truthfully, if you only learn to use text files, you are seriously going to hurt yourself in the long run when you need to make php scripts that hold customer information, authentication, reports, etc...
Posted: Sat Oct 26, 2002 1:50 pm
by mydimension
i concure, use a database whenever and wherever possible.
Posted: Sat Oct 26, 2002 2:31 pm
by Takuma
Database are designed for these jobs whereas file system isn't. Also .txt you can view the content much more easily than database. Even if you encrypt the password it's still dangerous since you can brute force attack the string. Just learn to use MySQL or PostgreSQL and you can implement it on any other project!