<?php
include('connection.php');

if(isset($_POST['label']) && isset($_POST['id'])) {
    $selectedLabel = $_POST['label'];
    $rowId = $_POST['id'];

    // Update the label in the database
    $updateSql = "UPDATE add_catalouge SET label = '$selectedLabel' WHERE id = $rowId";
    if(mysqli_query($conn, $updateSql)) {
        echo $selectedLabel;
    }
}
?>
