<?php
require 'db.php'; // your DB connection file

if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $id = $_POST['id'] ?? null;
    $app_name = $_POST['app_name'] ?? '';

    if ($id && $app_name) {
        $stmt = $conn->prepare("UPDATE scanned_auths SET app_name = ? WHERE id = ?");
        $stmt->bind_param("si", $app_name, $id);
        if ($stmt->execute()) {
            echo "App name updated successfully.";
        } else {
            echo "Error updating app name.";
        }
    } else {
        echo "Missing data.";
    }
}
?>
