The database doesn't get updated for some strange reason, I can get the correct data (I checked it), but the database does not get updated when I click submit. Can you anyone check if there is anything missing? NB: the "----" are just for security reasons!
<?php
$host = "sql308.-----.com";
$dbUsername = "----_3041----";
$dbPassword = "-----------";
$dbName = "----_3041----_phpmysqli";
$conn = mysqli_connect($host, $dbUsername, $dbPassword, $dbName);
// Check connection
if ($conn-> connect_error) {
die("Connection échouée!".$conn-> connect_error);
}
$rn = $_GET['rn'];
$dt = $_GET['dt'];
$to = $_GET['to'];
$rk = $_GET['rk'];
if(isset($_POST['edit'])) {
$rn = $_POST['rn'];
$dt = $_POST['date'];
$to = $_POST["total"];
$rk = $_POST['remarques'];
$sql = "UPDATE `datab1` SET
`date` = '$dt',
`total` = '$to',
`remarques` = '$rk'
WHERE `datab1`.`id` = '$rn'";
$result = mysqli_query($conn, $sql);
if($result == 1) {
header('location:table.php');
}
else {
die(mysqli_error($conn));
}
}
?>