On 20-Jul-2001 Er Galvão Abbott wrote:
> Just a sugestion here, that may sound strange, but I'd do it like
> this:
>
> Why don't you keep a simle text-counter file for each user? Why this
> HAVE to go trough SQL?
>
> Just creat a text file with "0" on it. When the user posts, retrieve
> the number from the file, increment it and then write it back...
>
> This way you don't overload SQL and keep the post counter running...
>
Because the database is optimized for this kind of stuff ?
Once you get the db handle (and you have. you've authenticated right ?),
"SELECT count(*) from msgposts where user_id=$foo" is likely be faster & less
load then an open/read/close.
Trying to avoid hitting the database is a good maxim, but it's not the goal.
Regards,
--
Don Read [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to
steal the neighbor's newspaper, that's the time to do it.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]