format("Y-m-d h:i:s"); // Create connection $conn = new mysqli($servername, $username, $password, $database); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $mykey = $_GET['keyID']; ; //UPDATE Alert Status to 1 if($mykey =="aha-6e59e008b5348b452b615a3033729daae383-tag"){ $userID = $_GET['userID']; $ahaTag = $_GET['ahaTag']; // SQL query $sql = "UPDATE `aha_pwd` SET `aha_tag`='$ahaTag' WHERE `aha_user_id`='$userID'"; if ($conn->query($sql) === TRUE) { echo json_encode(["status" => "Your AHA Tag has been updated."]); }else{ echo json_encode(["status" => "Error: Unable to update AHA tag"]); } } $conn->close(); ?>