<?php
function countRows($col, $tbl) {
// build user record display html
$connection = openConnection(); // connect to database
$query = mysqli_query($connection, "SELECT '$col' FROM '$tbl'"); // select a column to count rows - can be any column but it will include all rows
$number = mysqli_num_rows($query); // create query to select record from user_id and full_name columns
if($number) { // if a record exists then...
return "$number"; // display number of registered users minus logged in user
}
closeConnection($connection); // close database connection
}
?>