updating multiple rows in database when not all are mandatory

i am trying to give use a choice to upgrade some data in mysqli database. Also if a user chooses not to input anything or not to select (a date) anything then database should leave this as it is. I cannot find a problem with my code.

HTML:

        <h1>Nastavitve tečajev</h1><br><br>
    <form action="viv_settings_tecaji.php" method="post">
Datum termina (izberi ID):
  <input type="number" name="ID" required><br><br>
        Sprememba tega datuma (če ne želiš spremenit pusti prazno):
  <input type="date" name="nov_datum"><br><br>
       Sprememba statusa (če želiš da ostane isto vpiši trenutni status!:
  <input type="number" name="status"><br><br>
        Sprememba števila odprtih mest
  <input type="number" name="st_odprtih_mest"><br><br>
  <input type="submit">
</form><br>

PHP:

<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "viverius_education";


$conn = new mysqli($servername, $username, $password, $dbname);

$update_datum = $_POST['nov_datum'];
$update_status = $_POST['status'];
$update_st_odprtih_mest = $_POST['st_odprtih_mest'];
$update_ID = $_POST['ID'];



if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";
$sql = "UPDATE razpisani_tecaji 
SET 
DATUM = (case when '$update_datum' = '' then DATUM else '$update_datum' end),
STATUS = (case when '$update_status' = '' then STATUS else '$update_status' end),
ST_ODPRTIH_MEST = (case when '$update_st_odprtih_mest' = '' then ST_ODPRTIH_MEST else '$update_st_odprtih_mest' end),
WHERE ID_TECAJA = $update_ID";

if ($conn->query($sql) === TRUE) {
echo "New record created successfully";
header('Location: viv_settings.php'); exit;
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}$conn->close();

?>

If anyone ever needs: solution.

<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "viverius_education";


$conn = new mysqli($servername, $username, $password, $dbname);

//$update_datum = $_POST['nov_datum'];
$update_status = $_POST['status'];
$update_st_odprtih_mest = $_POST['st_odprtih_mest'];
$update_ID = $_POST['ID'];


//if(!empty($_POST['nov_datum'])) { $update_datum = $_POST['nov_datum']; } else { $update_datum = NULL; }
if(!empty($_POST['status'])) { $update_status = $_POST['status']; } else { $update_status  = NULL; }
if(!empty($_POST['st_odprtih_mest'])) { $update_st_odprtih_mest = $_POST['st_odprtih_mest']; } else { $update_st_odprtih_mest = NULL; }
if(!empty($_POST['ID'])) { $update_ID = $_POST['ID']; } else { $update_ID = NULL; }



if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";
$sql = "UPDATE razpisani_tecaji 
SET 

STATUS = $update_status,
ST_ODPRTIH_MEST = $update_st_odprtih_mest
WHERE ID_TECAJA = $update_ID";

if ($conn->query($sql) === TRUE) {
echo "New record created successfully";
header('Location: viv_settings.php'); exit;
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}$conn->close();

?>