How can the code provided be improved to ensure that data is reloaded correctly after an UPDATE query in PHP?

When an UPDATE query is executed in PHP, the data displayed on the webpage may not reflect the changes made in the database. To ensure that the data is reloaded correctly after an UPDATE query, you can add a code snippet to fetch the updated data from the database and display it on the webpage after the UPDATE query is executed.

// Execute the UPDATE query to update the data in the database

// Fetch the updated data from the database
$query = "SELECT * FROM your_table WHERE your_condition";
$result = mysqli_query($connection, $query);

// Display the updated data on the webpage
while($row = mysqli_fetch_assoc($result)) {
    echo $row['column1'] . " - " . $row['column2'] . "<br>";
}