php-general | 2001072
Date: 07/20/01
- Next message: Sheridan Saint-Michel: "Re: [PHP] Unlink Woes"
- Previous message: Sheridan Saint-Michel: "Re: [PHP] Unlink Woes"
- In reply to: Er Galvão Abbott: "[PHP] Re: (another, not entirely)sessions question"
- Next in thread: teo <email protected>: "Re: [PHP] Re: (another, not entirely)sessions question"
- Reply: teo <email protected>: "Re: [PHP] Re: (another, not entirely)sessions question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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 dread <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: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Sheridan Saint-Michel: "Re: [PHP] Unlink Woes"
- Previous message: Sheridan Saint-Michel: "Re: [PHP] Unlink Woes"
- In reply to: Er Galvão Abbott: "[PHP] Re: (another, not entirely)sessions question"
- Next in thread: teo <email protected>: "Re: [PHP] Re: (another, not entirely)sessions question"
- Reply: teo <email protected>: "Re: [PHP] Re: (another, not entirely)sessions question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

