$servername = "localhost";
$username = "root";
$password = "toor";
$dbname = "testdb";
$user = 'admin';
$conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$stmt = $conn->prepare("SELECT * FROM radcheck where username = :username ");
$stmt->bindParam(':username', $user);
$stmt->execute();
// set the resulting array to associative
// $result = $stmt->setFetchMode(PDO::FETCH_ASSOC);
$counter = $stmt->fetchAll();
echo "Total rows returned" .count($counter);