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...

Tell me what you think, even if you think it's stupid :)



On Fri, 20 Jul 2001 12:31:15 +0100, [EMAIL PROTECTED] (Conor
McTernan) wrote:

>Hey there, 
>
>I'm currently writing a web app using php. I was just looking for some
>advice on one aspect. On this site, users will be able to log in and post
>messages, or articles, or replies etc, you get the idea. 
>
>Anyway, I am storing some info about the users, the usual stuff, name,
>email, password, all in mysql. I am also storing other info, such as when
>they last posted, and how many times they have posted. 
>
>When a user posts a new message, the message is sent to mysql and stored
>in a table, at the same time, i also have to increment their total number
>of posts. The way this is done is by selecting the posts field on their
>userid, which i have to find using their username, which is set as a
>session var, when the user logs in. This all results in a good few
>queries to mysql. 
>
>I was wondering would it be better to load all the user info, e.g. number
>of posts, last post date, into session vars, or should i set a cookie on
>the client side, or should i just continue with the queries.
>
>Any help is appreciated.
>
>conor

       Er Galvão Abbott
         Webdeveloper
  [EMAIL PROTECTED]
---------------------------------
To send me an e-mail just remove
the CAPITAL TEXT.
---------------------------------

-- 
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]

Reply via email to