$user = filter_input(INPUT_POST, 'username');
$pass = filter_input(INPUT_POST, 'password');
$conn = new mysqli ('localhost', 'root', '', 'webexam');
if (mysqli_connect_error()){
die('Connect Error ('. mysqli_connect_errno() .') '
. mysqli_connect_error());
}
else{
$sql="SELECT username FROM account WHERE username='$user' AND password='$pass'";
if($user==$sql){
echo"LOGIN success";
}else{
echo"Check yo password";
}
}
?> I am planning to do login and registering system. Registering side is complete but seems like there is a problem in login side. Currently I am trying to compare the username that inserted and username that is in DB. But it is no go, please help. Thank you in advance.