<?php
if (isset($_GET['edit']))
{
?>
<form action="index.php" method="post">
<input type="text" name="id" value="<?=$id;?>">
<input type="text" name="nieuweprijs" placeholder="vul nieuwe prijs in">
<input type="submit" name="submitnieuweprijs" value="verzenden"><form>
<?php }
if (isset($_POST['submitnieuweprijs']))
{
$nieuweprijs = Safesql($_POST['nieuweprijs']);
$id = Safesql($_GET['id']);
if(!$mysqli->query("UPDATE prijzen SET prijs="".$nieuweprijs."" WHERE id='".$id."'"))
{ echo $mysqli->error;}
Laden(0);
}
}
?>
$id
is the value obtained from the query when editing data, you cannot update without ID definition or else
1
solved This update query won’t update record