Password Verification PHP Form : Here i have some php code which allows me to update User information in my students table. 

    <?php 
    $page_title = 'Update Info';
    require ('mysqli_connect.php');
    session_start();
    if(isset($_SESSION["UserID"])){
    }else{
        header('Location: login.php');
    }
    ?>
    <?php
    
    $User = $_SESSION["UserID"];
    
    $result = $conn->query("SELECT * FROM students WHERE UserID ='$User'");
     
    $row = $result -> fetch_array(MYSQLI_BOTH);
    $_SESSION["FirstName"] = $row['FName'];
    $_SESSION["LastName"] = $row['LName'];
    $_SESSION["Email"] = $row['Email'];
    $_SESSION["PW"] = $row['Password'];
    
    ?>
    
    <?php
    
        if(isset($_POST['Update'])){
            
            $UpdateFName = $_POST['FirstName'];
                $UpdateLName = $_POST['LastName'];        
                $UpdateEmail = $_POST['Email'];
                $UpdateFPassword = $_POST['Password'];
                
                $SQL = $conn->query("UPDATE students 
                SET FName='{$UpdateFName}',LName='{$UpdateLName}',Email='{$UpdateEmail}',Password='{$UpdateFPassword}'
                WHERE UserID = $User");
            
            header('Location:updateinfo.php');
        }
    
    header ('Location: myaccount.php')
    ?>

I am trying to figure out how am i able to check if the password for the user that is currently logged in matches the password stored in the database before allowing information can be updated. 

Help would be appreciated! thank you. 