<?php 
session_start();
include 'lib/dbcon.php'; 

$fname = $_POST['first_name'];
$lname = $_POST['last_name'];
$email = $_POST['email'];
$user = $_POST['user'];
 $data = "UPDATE admin set first_name='$fname',last_name='$lname',email='$email' where username='$user'";
if(mysqli_query($con,$data)){
    
    $_SESSION['msg_scs'] = "profile updated";
    header('location:profile.php');
    
}else{
       $_SESSION['msg_err'] = "Somethinh Went Wrong";
    header('location:profile.php');
       
}

?>