Stats- help needed!
Posted by Mandingo
Stats- help needed! June 25, 2004 03:43PM |
Registered: 21 years ago Posts: 109 |
I'm doing some basic stats for a site. I've got an idea to have a couple of simple messages saying -
1. There are 'x' registered users.
2. Our users have posted a total of 'x' messages.
So far, I've got a php script where I'm trying to count the total amount of registered users, with this -
mysql_select_db("$database");
$result = mysql_query("select count(*) as total from forum5_users");
while ($posts = mysql_fetch_array($result)) {
echo $users=count($total);
}
mysql_close($conn);
?>
I think I'm close to it, but it returns a number of 0. Any ideas where I'm going wrong?
I assume the technique for getting the total of all messages is similar?
1. There are 'x' registered users.
2. Our users have posted a total of 'x' messages.
So far, I've got a php script where I'm trying to count the total amount of registered users, with this -
mysql_select_db("$database");
$result = mysql_query("select count(*) as total from forum5_users");
while ($posts = mysql_fetch_array($result)) {
echo $users=count($total);
}
mysql_close($conn);
?>
I think I'm close to it, but it returns a number of 0. Any ideas where I'm going wrong?
I assume the technique for getting the total of all messages is similar?
Re: Stats- help needed! June 25, 2004 04:20PM |
Admin Registered: 20 years ago Posts: 9,240 |
Re: Stats- help needed! June 25, 2004 04:37PM |
Registered: 21 years ago Posts: 109 |
Sorry, only registered users may post in this forum.