<?php
error_reporting(0);

include('db_connect.php');
if(isset($_GET['email_address'])){
    $email=$_GET['email_address'];
    $token= $_GET['token'];
    $query1="UPDATE `users` SET `token`='$token' WHERE email_address='$email'";
  if(mysqli_query($conn,$query1)){
   $response['error'] = false; 
			$response['message'] = "Updated successfully";

  }else{
   	$response['error'] = true; 
			$response['message'] = "Some error occurred please try again";	
  }

$r=mysqli_query($conn,"select * from users where email_address='$email'");
while($row=mysqli_fetch_assoc($r))
{
$cls[]=$row;
}
echo json_encode($cls);
}
mysqli_close($conn);

?>