Help: RevCMS Stats

Rastaberry

Rooster 4 president 2k14
Dec 3, 2010
247
29
So I've been busy on a page where you can see for example how many users are registered etc. But I'm wondering since it needs to be done in PHP what do I put like to get the count in numbers how many people for example have registered. If anyone can help it would be much appreciated!
 

Rastaberry

Rooster 4 president 2k14
Dec 3, 2010
247
29
It's not confusing at all, the thing is. I want to show in my server statistics box for example how many people have registered and how many rooms have been made but it's something that needs to be done with Query's but I'm really stuck with it so maybe someone wants to help me out with this.
 

Rastaberry

Rooster 4 president 2k14
Dec 3, 2010
247
29
No shit sherlock, maybe you can help with it it would make it a lot easier, I've been waiting for ages now for someone to reply so better reply with something good other than that that doesn't help jacknuts.
 

Wickd

The first member of the Knights of the Pink Table
Jan 15, 2013
1,936
612
Here you go.
Code:
<?php
$query = mysql_query("SELECT COUNT(*) AS aantalleden FROM users") or die(mysql_error());
$data = mysql_fetch_assoc($query);

echo $data['aantalleden'];
?>

Badges
Code:
<?php
$query = mysql_query("SELECT COUNT(*) AS aantalbadges FROM user_badges") or die(mysql_error());
$data = mysql_fetch_assoc($query);

echo $data['aantalbadges'];
?>
Favorite rooms
Code:
<?php
$query = mysql_query("SELECT COUNT(*) AS aantalfavouritekamers FROM user_favorites") or die(mysql_error());
$data = mysql_fetch_assoc($query);

echo $data['aantalfavouritekamers'];
?>
Rooms
Code:
<?php
$query = mysql_query("SELECT COUNT(*) AS aantalkamers FROM rooms") or die(mysql_error());
$data = mysql_fetch_assoc($query);

echo $data['aantalkamers'];
?>



 
Last edited:

Wickd

The first member of the Knights of the Pink Table
Jan 15, 2013
1,936
612
Now if you want to display number of furniture use this.
Code:
<?php
$query = mysql_query("SELECT COUNT(*) AS aantalmeubels FROM furniture") or die(mysql_error());
$data = mysql_fetch_assoc($query);

echo $data['aantalmeubels'];
?>
Number of banned users, same query for everything just change the table name.
Code:
<?php
$query = mysql_query("SELECT COUNT(*) AS aantalmeubels FROM bans") or die(mysql_error());
$data = mysql_fetch_assoc($query);

echo $data['aantalmeubels'];
?>
 

JayC

Always Learning
Aug 8, 2013
5,493
1,398
No shit sherlock, maybe you can help with it it would make it a lot easier, I've been waiting for ages now for someone to reply so better reply with something good other than that that doesn't help jacknuts.
ok but these codes are all over forums, they are on google, on released CMS's and if you own a hotel you should at least know how to do simple shit like this.. My point is you can't be expected to be spoon fed like @Wickd just did, you need to learn things for yourself
 

Rastaberry

Rooster 4 president 2k14
Dec 3, 2010
247
29
Never mind was:

<?php
$query = mysql_query("SELECT COUNT(*) AS aantalleden FROM users") or die(mysql_error());
$data = mysql_fetch_assoc($query);

echo $data['aantalleden'];
?>

LOL! And that furniture in hotel and furniture in catalogue?
 

Whip

- FiveM Server Developer -
Nov 6, 2013
408
46
If You Still Need Help Here PHP Coded Just Add To Page.

PHP:
<div class="habblet-container ">

<div class="cbb clearfix red">

<h2 class="title">{hotelName} Statistics</h2>

<div id="notfound-content" class="box-content"> <center>

           Users online: <?php $sql = "SELECT COUNT(*) FROM users WHERE online = '1'";
$query = mysql_query($sql) or die(mysql_error());
$hoeveel = mysql_result($query,0,0);

echo $hoeveel;  ?> <br>
Registered Users:
<?php
$query = mysql_query("SELECT COUNT(*) AS aantalleden FROM users") or die(mysql_error());
$data = mysql_fetch_assoc($query);

echo $data['aantalleden'];
?>
<br />Rooms:
<?php
$query = mysql_query("SELECT COUNT(*) AS aantalkamers FROM rooms") or die(mysql_error());
$data = mysql_fetch_assoc($query);

echo $data['aantalkamers'];
?>
<br />Badges:
<?php
$query = mysql_query("SELECT COUNT(*) AS aantalbadges FROM user_badges") or die(mysql_error());
$data = mysql_fetch_assoc($query);

echo $data['aantalbadges'];
?>
<br />Favorite rooms:
<?php
$query = mysql_query("SELECT COUNT(*) AS aantalfavouritekamers FROM user_favorites") or die(mysql_error());
$data = mysql_fetch_assoc($query);

echo $data['aantalfavouritekamers'];
?>
<br />Furniture:
<?php
$query = mysql_query("SELECT COUNT(*) AS aantalmeubels FROM furniture") or die(mysql_error());
$data = mysql_fetch_assoc($query);

echo $data['aantalmeubels'];
?>
<br />Furniture in the catalog:
<?php
$query = mysql_query("SELECT COUNT(*) AS aantalmeubels FROM catalog_items") or die(mysql_error());
$data = mysql_fetch_assoc($query);

echo $data['aantalmeubels'];
?>
                     </center></a></div></div>
                     </div>
 

Users who are viewing this thread

Top