Firefox PHP

How do you show the Total Posts?

Posted by MattxWCWW 
How do you show the Total Posts?
May 16, 2003 09:59AM
I've seen on a couple of boards, they have the total amount of posts ever made displayed. I'm sure this is just a simple SQL command that counts the rows in your forum table...any help on how I go about doing this?
Re: How do you show the Total Posts?
September 09, 2003 02:30AM
The code would go something like this:


$sqlhostname = "DATABASE SERVER HERE";

$db_connect = mysql_connect($sqlhostname,$login,$password);
$base_selection = mysql_select_db($base,$db_connect);

$query = "SELECT * FROM phorumtablename";
$req = mysql_query($query);
$totalpost = mysql_num_rows($req);

echo "There are $totalpost posts in my forum!";

(excuse the bad PHP (if any), I'm new).

What I'd like, though, is something similar which says "The forum has XX posts by YY different posters".

It would be easy, except my forum doesn't require a user to be logged in to post, so I need some way to count the number of uniqe names in a particular forum.

Does anybody know the SQL I need to do this?
Sorry, you do not have permission to post/reply in this forum.