Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Should I use a database?

Status
Not open for further replies.

Shagrat

Programmer
Joined
Jun 21, 2004
Messages
1
Location
BG
Hello there!
I'm quite new to PHP so I'd like to get some advice from you: I need a simple system which supports username-password combinations, can store submitted files and maybe execute some application.
I want to know what's the simplest way of storing info and manipulating it via PHP other than TXT files, which anyone can see. I mean security is not that crucial but nevertheless I don't like using TXT files.

Should I read about MySQL or something else ?

Thanks
 
You should DEFINITELY read up on mysql as php and mysql working seemlessly together. Storing information in a dbase is most definitely the safest way to go. I would suggest "SAMS teach yourself PHP, MySQL and Apache in 24 hours" togive you a good headstart. I would also suggest to store submitted files on the server file system and not in the database itself.

Hope this helps.

Reality is built on a foundation of dreams.
 
Text files are safe enough if you have the ability to use configure your webserver directories with .htaccess.

Personally I'd use MySQL tho :-)


______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
You can still have a secure text file.

1) store the text file in a directory above your web document root so that users cannot access the file. Your PHP script can call the TXT file from anywhere on the system.

2) do one-way encryption (md5) so that your passwords are not stored in their original form. When your PHP script accesses the text file, hash the user's login input and compare it to the stored hash. If the 2 do not match, deny access.

- - picklefish - -
Why is everyone in this forum responding to me as picklefish?
 
A simple system could be based on flat files, taking all the advice into consideration that forum members have provided.
As a longer term strategy the learning and use of MySQL appears to be beneficial, as you will probably encounter a need for it in the future. PHP MySQL or more generically PHP and database management is an important skill.

Write your system with interface functions to the data repository (txt/database) so you can exchange it whenever needed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top