When trying to execute my MYSQLi statement that's supposed to count rows. I don't get an error when I do a query but when I try and echo the result, it just breaks the html lines below the echo.
Here is my code:
$db = doDB();
$sql = "SELECT COUNT(*) From `Keys`";
$stmt = $db->query($sql)->fetchColumn();
doDB() Function:
function doDB() {
$dbHost = 'localhost';
$dbName = '';
$dbUser = '';
$dbPass = '';
$db = new mysqli($dbHost, $dbUser, $dbPass, $dbName);
return $db;
}