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

if (isset($_POST['order_id'])) {
    $product_name = mysqli_real_escape_string($conn, $_POST['product_name']);
    $price = mysqli_real_escape_string($conn, $_POST['price']);
    $order_id = $_POST['order_id'];

    $sql = "UPDATE product SET product_name = '$product_name', price = '$price' WHERE order_id = $order_id";

    $result = mysqli_query($conn, $sql);

    if ($result) {
        header("Location: product_price.php?success=Order Sent Successfully!!!");
        exit();
    } else {
        header("Location: product_price.php?error=Failed insertion!!!");
        exit();
    }
} else {
    header("Location:product_price.php?error=Not submitted!!!");
    exit();
}
?>
