Jungleman
07-10-2002, 10:12 PM
OK, I'm not sure if it's already been done but I'm making something which shows the person with the most posts per day at the top of the forum...
First of all, I've added a new column to the "user" table which has posts per day of each user, and it sticks the user's posts per day in that field and that is the value that shows up on the home page...I am using the following query to generate those numbers:
UPDATE user SET ppd=posts/((UNIX_TIMESTAMP(NOW())-joindate)/86400)
Only problem is I don't want to keep manually running that query, how can I make it so it runs that query whenever someone loads index.php?
Secondly, I need to round the number to the nearest 100th. How can I do that?
Thanks...
First of all, I've added a new column to the "user" table which has posts per day of each user, and it sticks the user's posts per day in that field and that is the value that shows up on the home page...I am using the following query to generate those numbers:
UPDATE user SET ppd=posts/((UNIX_TIMESTAMP(NOW())-joindate)/86400)
Only problem is I don't want to keep manually running that query, how can I make it so it runs that query whenever someone loads index.php?
Secondly, I need to round the number to the nearest 100th. How can I do that?
Thanks...