Jump to content


Photo
- - - - -

Displaying IPB Stats


  • Please log in to reply
5 replies to this topic

#1 Slashman X

Slashman X

    Young Padawan

  • Members
  • Pip
  • 56 posts
  • Gender:Male

Posted 30 March 2007 - 05:26 PM

Didnt see it posted here so i thought i'd post a tut for this

<?php
	//CONNECT TO FORUMS DB//
  $conn = mysql_connect("localhost","FORUMSDBUSERNAME","DBPASSWORD");
   mysql_select_db(FORUMDBNAME) or die(mysql_error());
$members = mysql_query("SELECT * FROM ibf_members");//Selects the member db
$total_members = mysql_num_rows ($members);//Counts the # of rows of member db
$posts = mysql_query("SELECT * FROM ibf_posts");//Selects post db
$total_posts = mysql_num_rows ($posts);//Counts rows of post db

?>

Put That At the top of the page, replace capital letters in $conn

Now somewhere in your page put

<?php
echo $total_members;
					
echo $total_posts; 
?>


to show the stats
  • Moniqueoa likes this

#2 Xuxiix

Xuxiix

    Young Padawan

  • Members
  • Pip
  • 7 posts

Posted 02 April 2007 - 06:21 AM

This isn't much of a tutorial. And, about this: "Put That At the top of the page, replace capital letters in $conn." What about the "FORUMDBNAME" in mysql_secelt_db? They don't have to edit that? (Because it's not in $conn.) Oh, and also, what if they aren't runnning their MySQL server on localhost? (Although I know most people does.) You should also describe it some more.

Ahh well, too much critism, and maybe I'm just expecting more from tutorials. By the way, it's a nice cool little trick.

Kkthxbai. ;)

Edited by Xuxiix, 02 April 2007 - 06:22 AM.


#3 Slashman X

Slashman X

    Young Padawan

  • Members
  • Pip
  • 56 posts
  • Gender:Male

Posted 02 April 2007 - 07:30 PM

I knows it not much, btw, FORUMDBNAME is just under $conn :angry:

#4 Xuxiix

Xuxiix

    Young Padawan

  • Members
  • Pip
  • 7 posts

Posted 03 April 2007 - 06:19 PM

I knows it not much, btw, FORUMDBNAME is just under $conn :winner:

You mean below it? :)

#5 Ghost

Ghost

    Honored P2L Member

  • P2L Staff
  • PipPipPip
  • 675 posts
  • Gender:Male
  • Location:Australia

Posted 12 April 2007 - 03:43 AM

"Under" means "below"... :biggrin:

#6 Xuxiix

Xuxiix

    Young Padawan

  • Members
  • Pip
  • 7 posts

Posted 12 April 2007 - 06:28 AM

"Under" means "below"... :blink:

Oh. :biggrin:




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users