PDA

View Full Version : trying to call forum stats, help!!! i'm sabe


sabret00the
10-18-2003, 10:22 AM
i've predefined these

// Get Community Stats Data
$totalmembers = "SELECT COUNT (*) AS userid FROM user";
$totalthreads = "SELECT COUNT(*) AS threads FROM thread";
$totalposts = "SELECT COUNT(*) AS posts FROM post";

then later defined the way i want them displayed
// Display Community Stats
$fs_members = "Members: $totalmembers";
$fs_threads = "Threads: $totalthreads";
$fs_posts = "Posts: $totalposts";

then thought that i was supposed to be recalling the info as simple as
Community Statistics:<br />
<?php echo($fs_members); ?><br />
<?php echo($fs_threads); ?><br />
<?php echo($fs_posts); ?><br />


but all i get is


Community Statistics:
Members: SELECT COUNT (*) AS userid FROM user
Threads: SELECT COUNT(*) AS threads FROM thread
Posts: SELECT COUNT(*) AS posts FROM post
what am i doing wrong :nervous:

assassingod
10-18-2003, 10:29 AM
What you are doing isn't a query;)

use;


$countposts=$DB_site->query_first('SELECT COUNT(*) AS posts FROM post');
$totalposts=number_format($countposts['posts']);

$countthreads=$DB_site->query_first('SELECT COUNT(*) AS threads FROM thread');
$totalthreads=number_format($countthreads['threads']);

$countmembers=$DB_site->query_first('SELECT COUNT(*) AS users,MAX(userid) AS max FROM user');
$totalmembers=number_format($countmembers['users']);

sabret00the
10-18-2003, 10:41 AM
assassin, you're my savioud, i'm gonna have to dress you up in a red cape and stick an S on your chest :)

assassingod
10-18-2003, 10:43 AM
assassin, you're my savioud, i'm gonna have to dress you up in a red cape and stick an S on your chest :)
LOL! Alrighty:p