How can MySQL be configured to properly store German Umlauts in a database when using XAMPP?

To properly store German Umlauts in a MySQL database when using XAMPP, you need to make sure that the character set and collation settings are configured correctly. You can set the character set to 'utf8mb4' and the collation to 'utf8mb4_unicode_ci' to support a wider range of characters, including German Umlauts.

// Connect to the database
$mysqli = new mysqli("localhost", "username", "password", "database");

// Set the character set and collation
$mysqli->set_charset("utf8mb4");
$mysqli->query("SET collation_connection = 'utf8mb4_unicode_ci'");