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

4
  • What collation are you using for the table? Commented Apr 6, 2022 at 11:54
  • The collation I use is utf8mb4_unicode_ci Commented Apr 6, 2022 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. Commented Mar 31, 2023 at 2:48
  • See this for more info on how "question marks" happen: stackoverflow.com/questions/38363566/… Commented May 1, 2023 at 17:49

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.