<?php 
include('connection.php');
if (isset($_POST['update'])) {
   


    $price = $_POST['price'];
    $id = $_POST['id'];
    $update_by='Admin';
    // Update the existing record
    $update_sql = "UPDATE product SET price = '$price'WHERE id='$id'";
    
    $update_result = mysqli_query($conn, $update_sql);

    if ($update_result) {
        // echo "Update successful!";
        header("Location: product_price.php?msg=1");
        exit();
    } else {
        // echo "Update failed: " . mysqli_error($conn);
        header("Location: product_price.php?msg=2");
        exit();
    }
}


?>