2007-03-13, 12:26 AM
I hope this thread isnt too old...
On the forum statistics everything works except for the Registered users stat, it just displays 13 but not "13 users"...
Code:
On the forum statistics everything works except for the Registered users stat, it just displays 13 but not "13 users"...
Code:
<?php
$host = "localhost"; // Your database host
$user = ""; // Your database username
$pass = ""; // Your database password
$data = ""; // The name of your database
$prfx = ""; // The table prefix of your database
$conn = mysql_connect($host,$user,$pass) or die ("<b>Error:</b> Database connection failed.");
$sel = mysql_select_db($data,$conn) or die("<b>Error:</b> Database connection failed.");
$topic_result = mysql_query("SELECT COUNT(*) as count FROM ".$prfx."threads");
$topic_count = mysql_fetch_array($topic_result);
$topic_count = $topic_count["count"];
$post_result = mysql_query("SELECT COUNT(*) as count FROM ".$prfx."posts");
$post_count = mysql_fetch_array($post_result);
$post_count = $post_count["count"];
$user_result = mysql_query("SELECT COUNT(*) as count FROM ".$prfx."users");
$user_count = mysql_fetch_array($user_result);
$user_count = $user_count["count"];
$forum_result = mysql_query("SELECT COUNT(*) as count FROM ".$prfx."forums");
$forum_count = mysql_fetch_array($forum_result);
$forum_count = $forum_count["count"];
?>
<table>
<tr>
<td><b><?php echo $topic_count; ?></b></td>
<td>Threads</td>
</tr>
<tr>
<td><b><?php echo $post_count; ?></b></td>
<td>Posts</td>
</tr>
<tr>
<td><b><?php echo $user_count; ?></b></td>
</tr>
<tr>
<td><b><?php echo $forum_count; ?></b></td>
<td>Forums</td>
</tr>
</table>