<?php 
include ('database.php');
session_start();

if(isset($_POST['submit']));
{
    $address = mysqli_real_escape_string($connection, $_POST['address']);
	$id = mysqli_real_escape_string($connection, $_POST['id']);
    

  
  $query = "UPDATE users SET address='$address' WHERE id='$id' LIMIT 1";
  $query_run = mysqli_query($connection, $query);
 
 if($query_run)
  {
 	 

	 $_SESSION['status'] = "<h5 style='padding:8px; background: #1a1849; border-radius: 10px; color: #fff; text-align: center;'>ADDRESS UPDATED SUCCESSFULLY</h5>";
		
	 header("location:../settings.php"); 
 }
 else
 {
	  $_SESSION['status'] = "<h5 style='padding:8px; background: #fe8b8e; border-radius: 10px; color: #fff; text-align: center;'>Failed To Update</h5>";
       
	header("location: ../settings.php");  
 }
}
 
?>