vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   trying to call forum stats, help!!! i'm sabe (https://vborg.vbsupport.ru/showthread.php?t=57971)

sabret00the 10-18-2003 10:22 AM

trying to call forum stats, help!!! i'm sabe
 
i've predefined these

PHP Code:

// 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
PHP Code:

// 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
Code:

          Community Statistics:<br />
  <?php echo($fs_members); ?><br />
  <?php echo($fs_threads); ?><br />
  <?php echo($fs_posts); ?><br />

but all i get is

Quote:

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;

Code:

$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

Quote:

Originally Posted by sabret00the
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


All times are GMT. The time now is 01:44 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01736 seconds
  • Memory Usage 1,730KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (2)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete