I can get UTF-8 letters from database for example these: ąčęėįšųūž, but can't insert them to database, for some reason only š
gets inserted into database, the rest are inserted as ?
. I'm connecting to my database through this file:
<?php
$GLOBALS['mysqli'] = new mysqli("...", "...", "...", "...");
$stmt = $GLOBALS['mysqli'] -> prepare("SET NAMES 'utf8'");
$stmt->execute();
?>
And then inserting data through this code:
$linkName = $_POST['linkName'];
$stmt = $GLOBALS['mysqli'] -> prepare
("
INSERT INTO NavigationLinks (linkName, fileName, iconExt)
VALUES (?, ?, ?)
");
$stmt->bind_param("sss", $linkName, $fileName, $iconExt);
$stmt->execute();
$stmt->close();
Before insertion I've tried to echo $linkName
and it outputs correct characters.