View Single Post
Old 12-29-2012, 09:17 PM   PM User | #4
tangoforce
Senior Coder

 
tangoforce's Avatar
 
Join Date: Feb 2011
Location: Your Monitor
Posts: 3,503
Thanks: 45
Thanked 439 Times in 428 Posts
tangoforce will become famous soon enoughtangoforce will become famous soon enough
You could do that but then supposing you need to cross reference data, count how many users submitted a form within a 24 hour period etc? You'd need to open up possibly thousands of files (consuming system memory) and then loop through every single one, store things in an array (using more memory) etc etc.

With a database you just run a query, the database does it all in a memory efficient way and returns only the data you need and in a fraction of the time.

I speak from personal experience. I avoided databases like they were the plague - for years on end. I used text files for several projects and all you end up doing is chasing your own tail around, debugging why things don't work, why did that bit of data get wiped etc. It really is far easier to use a database and it really isn't as hard as you think either.
__________________
Please wrap your code in [php] tags. It is a sticky topic and it HELPS us to HELP YOU!
TIP: Coding styles and $end errors :::::::::: TIP: Warning: Cannot modify header information - headers already sent :::::::::: TIP: Quotes / Parse error: syntax error, unexpected T_..
PHP Code:
//Please don't use this for your form processing:
if (isset($_POST['submit']))
//Internet explorer has a bug and does not always send the submit value. 
Explanation: The IE if(isset($_POST['submit'])) bug explained.
tangoforce is offline   Reply With Quote