<?php
if(isset($_POST['updatebtn']))
{
    $id = $_POST['id'];
    $password = $_POST['new_password'];
    $email = $_POST['email'];

    $con = mysqli_connect("localhost", "sprizbgf_admin", "IWUJ1Ge;;d^I", "sprizbgf_bank");
    $query = "UPDATE customers SET Email='$email', Password='$password' WHERE id='$id' ";
    $query_run = mysqli_query($con, $query);

    if($query_run)
    {
        $_SESSION['status'] = "Your Data is Updated";
        $_SESSION['status_code'] = "success";
        echo '<script>alert("Successfully, Changed!")</script>';
        echo "<script>window.location.replace('index.php');</script>";
    }
    else
    {
        $_SESSION['status'] = "Your Data is NOT Updated";
        $_SESSION['status_code'] = "error";
        echo '<script>alert("An error occurred!")</script>';
    }
}
    
    
?>
    