getConnection(); $action = isset($_GET['action']) ? $_GET['action'] : ''; $udid = isset($_GET['udid']) ? $_GET['udid'] : ''; $resultID = isset($_GET['id']) ? $_GET['id'] : ''; if($action == 'delete'){ $data = [ ':id' => $resultID ]; $query = "UPDATE speedsmart_results SET is_visible = 0 WHERE id = :id"; $stmt= $conn->prepare($query); $stmt->execute($data); echo json_encode(array('success' => $resultID), JSON_PRETTY_PRINT); } if($action == 'clear'){ // print 'clear'; mysqli_query($db, "UPDATE speedsmart_results SET is_visible = 0 WHERE device_key = '$udid' "); //return false; } ?>