alert('Wrong Password...');"; } } } } if(isset($_POST['student_login'])){ $connection = mysqli_connect("localhost","root",""); $db = mysqli_select_db($connection,"project"); $query = "select * from studentlogin where roll = '$_POST[roll]'"; $query_run = mysqli_query($connection,$query); while($row = mysqli_fetch_assoc($query_run)){ if($row['roll'] == $_POST['roll']){ if($row['u_password'] == $_POST['s_password']){ $_SESSION['roll'] = $row['roll']; $_SESSION['s_password'] = $row['u_password']; header("Location:student_dashboard.php"); } else{ echo ""; } } } } ?>