What considerations should be made when updating the Preis or Grundpreis values in the database?

When updating the Preis or Grundpreis values in the database, it is important to ensure that the values being updated are accurate and properly formatted. Additionally, any calculations or conversions should be double-checked to avoid errors in the database. It is also important to consider any potential impact on other parts of the system that rely on these values.

<?php
// Assuming $newPreis and $newGrundpreis are the updated values
$newPreis = 10.99;
$newGrundpreis = 5.99;

// Validate and format the values before updating the database
$newPreis = number_format($newPreis, 2);
$newGrundpreis = number_format($newGrundpreis, 2);

// Update the database with the new values
// $sql = "UPDATE products SET preis = $newPreis, grundpreis = $newGrundpreis WHERE id = $productId";
// mysqli_query($conn, $sql);
?>