Update data to MySQL #

modify.php
<?php
    require_once('db.php');

    if(isset($_GET['id']) && isset($_POST['editForm'])){
        $id = $_GET['id'];
        $name = $_POST['pname'];
        $price = $_POST['pprice'];
        $description = $_POST['pdescription'];

        $sql = "UPDATE `product` SET 
                `name`= '$name',
                `price`= '$price',
                `description`= '$description' 
                WHERE id = $id";

        if($con->query($sql) === TRUE){
            header('Location: http://localhost/crud/product.php?id=' . $id);
        }else{
            echo "something went wrong";
        }
        
    }else{
        echo "invalid";
    }
?>