How can a beginner in PHP effectively modify the provided PHP file to address the issue of displaying the dummy image (keinbild.jpg) when no image is present in the database?

When no image is present in the database, the PHP code should check for this condition and display a default image (keinbild.jpg) instead. This can be achieved by querying the database for the image path and checking if it is empty. If it is empty, the code should display the default image instead.

<?php
// Query database for image path
$image_path = // Query database for image path;

// Check if image path is empty
if(empty($image_path)) {
    $image_path = 'keinbild.jpg'; // Set default image path
}

// Display image
echo '<img src="' . $image_path . '" alt="Product Image">';
?>