I need to insert Croatian characters in MySQL database.
I have done all most everything but I still have a problem when I want to insert some Croatian characters.
What have I done so far:
- I have downloaded and installed MySQL Server 5.6 hoping that I will see Croatian collation but I couldn't find it...
- I have set entire database and each of the columns on UTF8-default collation
- I have put this into my php script:
header("Content-Type: text/html;charset=utf-8");
- I have tried all of the combinations such as (setting everything on cp1250, latin2-croatian-ci) and still no luck
Some of the inputs that are inserted in the database are: æèæžš
and it should be ćčćžš
..this was just for testing...
Does anyone has any idea of what I can do next? I really hope that there is some sort of solution for this particular type of problem.
And I am sure that a lot of people were hitting the wall just like me when we are speaking about Croatian characters in MySQL database.
EDIT: Code for inserting ( this is just for testing so it's simplify)
<?php
header("Content-Type: text/html;charset=utf-8");
$con=mysqli_connect("127.0.0.1:3306","root","admin","test");
if (!$con)
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$sql="INSERT INTO test(test) VALUES('ćčćžš')";
if (!mysqli_query($con,$sql))
{
die('Error: ' . mysqli_error($con));
}else
{
print '<script type="text/javascript">alert("ok")</script>';
}
mysqli_close($con);
?>