Doing a project with Login, Register Options but came upon an issue with logging in to the profile.
After Inputting correct data in email, password field it doesn't echo the Success text but echoes the Incorrect Username or Password.
From what I'm seeing if($st->num_rows() == 1){
migt be the issue but cant seem to find how to fix it.
public function Login($Email, $Password){
if(!empty($Email) && !empty($Password)){
$st = $this->db->prepare("SELECT * FROM usertable WHERE Email=? and Password=?");
$st->bind_Param("ss", $Email,$Password);
//$st->bindParam(2, $Password);
$st->execute();
if($st->num_rows() == 1){
echo 'Login Was Sucessfull';
header('Location: Success.php');
}else {
echo 'Incorrect Username Or Password';
}
}else {
echo '<script type="text/javascript">alert("Please Enter Username or Password");</script>';
}
}