My code below is not getting the id to update the database. The id is on the page URL coming from another page's form. No errors display on screen but my database does not update.
Am i missing something?
<?php
if (isset($_POST['submit'])) {
$id = $_POST["id"];
$product_name = $_POST["product_name"];
$visible = $_POST["visible"];
$query = "UPDATE products SET ";
$query .= "product_name = '{$product_name}', ";
$query .= "visible = {$visible} ";
$query .= "WHERE id = $id ";
$result = mysqli_query($connection, $query);
}
?>