View Single Post
Old 05-19-2005, 02:32 PM   #13 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 705
DJMaze is on a distinguished road
Quote:
Originally Posted by teknomage1
Isn't a database overkill for a hit counter? That's equivalent to driving across the street.
Not entirely.
Say the file has 1 million entries.
Which will be faster to load: the file or a single SQL query result ?
Which will use less memory: the full file or a single SQL query result ?

Quote:
Originally Posted by teknomage1
Simply locking the file on write and checking for a lock before reading should solve the problem. Here's the php page on flock http://www.php.net/manual/en/function.flock.php.
i already explained flock here:
Hitcounter problem
The MySQL example is just a follow up to an already available solution.
DJMaze is offline   Reply With Quote