I have this code for connecting PDO:
$conn = new PDO('mysql:host = localhost; dbname = DataBase', 'kkk', 'kkkkkk');
if ( $conn ) { echo 'Connect Shodee'; }
} catch (PDOException $e) {
$e->error();
}
and this lines for INSERT the values:
function InsertFileToDb($filename, $filetype, $recieve, $update, $from, $comment, $file) {
$sql="INSERT INTO `DataBase`.`assistance`(`filename`,`filetype`,`recieve`,`update`,`from`,`comment`,`file`) VALUES(:filename, :filetype, :recieve, :update, :from, :comment, :file)";
$prepare = $conn->prepare($sql);
$result = $prepare->execute(array(
':filename'=>$filename, ':filetype'=>$filetype, ':recieve'=>$recieve,
':update'=>$update, ':from'=>$from, ':comment'=>$comment, ':file'=>$file));
but when I fetch the data from my DB, some values like $from
that is in UTF-8 encoding become just like 0o_xd7sjnc,x
...
would you tell me what is wrong?
I checked HERE and HERE and some other posts bt didn't find the right answer...