So, when I update stuff in my database it turns for example this: Š
to this: u0160
it would be ok if it turned into this: \u0160
so it would display right but it doesn’t.
This is my connection file:
<?php
define('DB_SERVER', 'localhost');
define('DB_USERNAME', 'root');
define('DB_PASSWORD', 'pwd');
define('DB_DATABASE', 'database');
$db = mysqli_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_DATABASE);
mysqli_set_charset($db,"utf8");
mysqli_query("set names utf8");
?>
And this is the query:
mysqli_query($db, "UPDATE schools SET subjectData='$json' WHERE id='$schoolID'");
- Value of
$json
:{"subject":"A","desc":"A\u017d"}
- Value of db entry:
{"subject":"A","desc":"Au017d"}