I want to use Danish chars on my database (MySqli)
Normally this is not an issue, and i have been running my code with no problem at all. When i recently changed to Unoeuro there was nothing that worked - Same code, same DB, nothing has changed but the hosting service.
Here is how i connect to the database
<?
$conn=mysqli_connect("MyHost","MyUser","MyPass","MyDB");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
mysqli_set_charset($conn,"utf8");
?>
The connection to the databse works perfect, but when i send a Danish charto the DB, it changes to another unknown char.
Here is an example of my page that sends data to the mysqli:
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<?
include "config.php"; //The Database connection
/*
Here are a lot of variables, not important in this question
*/
mysqli_query($con,"INSERT INTO WaterWithdrawalLog (XUserID, Location, antalLiter,chipId,note) VALUES('$xuid','$location','$MinusAntalLiter','$usrid','".$_GET["note"]."')");
?>
The Database is set to UTF8_danish_ci
How to i get the Danish chars to show propperly in my database ??