next block is located in class that inherits database class,connect() is my method for connecting to a database
protected function checkUser($username){
$searchForUser=$this->connect()->prepare('select username from users where username=?;');
if($searchForUser->execute(array($username))){
$searchForUser=null;
header("location: ../login.php?error=existing_username");
exit();
}
$check=false;
if($searchForUser->rowCount()>0){
$check=true;
}
return $check;
}
next block is from class that inherits a class above
private function checkForUserExistance(){
$value = false;
if($this->checkUser($this->username)){
$value=true;
}
return $value;
}