public function Validate($username,$password) {
$stmp = $this->db->prepare("SELECT * FROM users WHERE username=? and password = ?");
$stmp->bindParam(1, $username);
$stmp->bindParam(2, $password);
$stmp->execute();
$this->session = $username;
if($stmp->rowCount() == 1) {
$this->session = $username;
}
}
public function LoggedIn() {
echo $this->session;
}
So I have these 2 functions, and I want to be able to echo $this->session inside the LoggedIn(), although it seems impossible right now as the variable is inside an if statement. It works if I put the variable out of the statement. Any suggestions or Idea on how I can do this properly?
This is telling you that $stmp->rowCount() is not equal to 1. Do the following:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With