Save emoji in mysql database

How to save emoji message in mysql database ?
I have a textarea !!!
But I typing a emoji it insert a blank string in my db

You need to use utf8mb4 encoding in your mysql database in order to be able to store emojis.

ok, it works great
and to display the emoticons in a text area how can I do?

What issues do you have displaying them?

I want to view emoticon in my chat system
in my db for example I have ??? for smile
How to view smile emoticon in my paragraph or in my textarea ?

1 Like

link at page: https://assistenza.decoresin.com/

I had to modify connection.php as shown here:

I’m not sure if Wappler handles this automatically now.

what is the exact value stored in your database? Can you share a screenshot please?

Do you have a direct access to your database like using phpmyadmin to check directly the db values?

So they don’t seem to be stored properly? Are you sure you have set the database encoding / table collation to utf8mb4?

image

same result ???

You use PHP?

Edit dmxConnectLib/lib/db/Connection.php line 61:

PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8',

change it to:

PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4',

ok it work fine ! Thank you

one question

how can I view è color emoticon in my web page ?

at this moment I see this:
image

the emoticon is black and white, I want view the real color emoticon !

Hey @patrick,
Any idea how to make it work on a NodeJS project too?

Also, since I’m on a Docker hosting, is there any easy way to convert the table to utf8mb4? :smiley:

bump - I’d like to know this too for Node JS