0

When I add an emoji to the database, it appears as (???)

Use this method to add and update data

$post_Text = 'Wh22 ';   
$update_post =$database->prepare("UPDATE `Wo_Posts` SET `postText` = :postText WHERE `Wo_Posts`.`id` = 7346"); 
$update_post->bindParam("postText",$post_Text);
$update_post->execute();

The result in the database was like this

Wh22 ???????????? 

The collation I use is utf8mb4_unicode_ci

sss
  • 19
  • 4
  • What collation are you using for the table? – BenM Apr 06 '22 at 11:54
  • The collation I use is utf8mb4_unicode_ci – sss Apr 06 '22 at 12:02
  • It appears as question marks in the database but when you retrieve it and display it in your webpage it should still look like an emoji. – Vincent Mar 31 '23 at 02:48
  • See this for more info on how "question marks" happen: https://stackoverflow.com/questions/38363566/trouble-with-utf8-characters-what-i-see-is-not-what-i-stored – Rick James May 01 '23 at 17:49

0 Answers0