Discord Server TwitterDonation
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
php mybb_user query show registered members
#1
display number of users registered on your forum

display all registered user in user group id 2 
"SELECT COUNT(*) FROM `mybb_users` WHERE usergroup=2"
display all user registered 
"SELECT COUNT(*) FROM `mybb_users`"


PHP Code:
<?php
$servername 
"localhost";
$username "database username";
$password "database-password";
$dbname "database-name";

// Create connection
$conn = new mysqli($servername$username$password$dbname);
// Check connection
if ($conn->connect_error) {
 
   die("Connection failed: " $conn->connect_error);


$sql "SELECT COUNT(*) FROM `mybb_users`";
$result $conn->query($sql);

if (
$result->num_rows 0) {
 
   echo "Number of users ";
 
   // output data of each row
 
   while($row $result->fetch_assoc()) {
 echo 
"<font color=red size=4>" $row["COUNT(*)"]. "</font>";
 
   }

} else {
 
   echo "0 results";
}

$conn->close();
?>
[img=0x0]https://hackmyass.files.wordpress.com/2011/01/hackers.jpg[/img]
Reply
#2
Thank you my friend keep it up Smile

[Image: 0yaXvcy.gif]
We Are Anonymous, We Are Legion, We Do not Forgive, We do not Forget
Expect Us
Reply




Users browsing this thread: 1 Guest(s)