I have some value in other language and i want to use utf-8 for this value.for now i use this code for store variable in database.
<?php
$fname=$_POST['fname'];
$lname=$_POST['lname'];
$mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE);
$stmt=$mysqli->prepare("INSERT INTO user (fname , lname) VALUES (? , ? ) ");
$stmt->bind_param("ss",$fname,$lname);
$stmt->execute();
?>
I set collation for fname and lname column to utf-8.but i do not know how to modify database connection for insert variable as utf-8.I set collation of user table as utf-8.
header('Content-Type: text/html; charset=utf-8');on top of your file