To be really fussy I'd be changing the query in the function to "select count..., then test to see if the answer was > 0 and return true or false. Your main script would then be
$URL = explode("/", $_SERVER['REQUEST_URI']);
$teamName = $URL[2];
$teamExists = $db -> checkIfTeamExists($teamName);
var_dump($teamExists);exit();
if ($teamExists) {
$teamNameUpper = ucwords(strtolower($teamName));
}
else {var_dump($teamExists);}
I've changed the print to a var_dump but pretty much anything that isn't false should still be true. I'd be interested to know what you get from the var_dump though.