MyBB Community Forums

Full Version: member count
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hey guys!
i wanted to create a file, that prints the number of users registred to the board and nothing else. i'm not that good at php and i just can't get it work. i hope you can hel me with that Rolleyes
<?php
define('IN_MYBB', 1);
define('NO_ONLINE', 1);

require('./global.php');

$query = $db->simple_select(TABLE_PREFIX."users", "COUNT(uid) AS count");
$array = $db->fetch_array($query);

echo $array['count'];
?>

Try putting that in a file like numusers.php and put it in the folder where MyBB is located.
McFish Wrote:hey guys!
i wanted to create a file, that prints the number of users registred to the board and nothing else. i'm not that good at php and i just can't get it work.  i hope you can hel me with that Rolleyes


<?php

define("IN_MYBB", 1);

require_once "./global.php";

$query = $db->simple_select(TABLE_PREFIX."users", "COUNT(*) AS amount", "");

$num = $db->fetch_field($query, "amount");

echo $num;

?>
tank you!
DennisTT Wrote:
<?php
define('IN_MYBB', 1);
define('NO_ONLINE', 1);

require('./global.php');

$query = $db->simple_select(TABLE_PREFIX."users", "COUNT(uid) AS count");
$array = $db->fetch_array($query);

echo $array['count'];
?>

Try putting that in a file like numusers.php and put it in the folder where MyBB is located.

is there such a thing to excluse the users awaiting for administrating? so not all users but only the registered?