Discord Server Red Security Twitter Donation to Red Security Red Security Youtube Channel Red Security Tumblr Profile
Windscribe
Login or Register to Hide ads and Accessing all features on the forum
Thread Rating:
  • 2 Vote(s) - 3 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
Rs
* Thankful to Allah *
Kurdy
Reply




Users browsing this thread: 1 Guest(s)