Can anybody helps me in how to change the encoding of the database, because when I try to execute the following query :
$stmt=$conn->prepare("INSERT INTO photo (id_user,name) VALUES(:id_user,:name)");
$stmt->execute(array(
"id_user" => 1,
"name" => 'allèèeeâ'
));
In the database I get the following result : allèèeeâ. I tried to run the following command to solve the problem :
ALTER DATABASE databasename CHARACTER SET utf8 COLLATE utf8_unicode_ci;
ALTER TABLE tablename CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
But it did not solve the problem.
Thank you for your help.