PHP - Flat file or database

Associate
Joined
27 Jun 2006
Posts
1,473
Evening all, just a general opinion needed here.

I have a website that people visit, now I want to make sure that they can only access once a day.

What I plan to do is write their IP address to either a flat file or MySQL database so if they come back, the IP is checked to see if its in the database / file already - if it is they get redirected to a 'Try again tomorrow' page else they can access the page.

At a guess the page is visited by between 300 - 700 people so my question would a flat file or database be better to implement?

The database would involve accessing / searching / inserting data whereas the text file would be write toand read into an array.

I am leaning towards the flat file just because I am lazy but wondered what you guys would do.

Cheers
 
Would there be much of a performance difference if the database is one column with IP addresses and the text file just contains IP addresses?

Not questioning your answer, just wondered how much difference there would be :)

Thanks for the reply so quickly as well
 
Cheers for all the suggestions - in the end I did 2 versions, 1 flat file and 1 database solution.

Will put them through their paces on some test sites to see how they do :)

Thanks again!
 
Back
Top Bottom