Welcome Guest, Not a member yet? Register   Sign In
Problem get data in MySQL 5.5 with table in UTF8mb4


I have a problem. In a database have register with emojis. The emoji is save like ut8mb4 encoding.

When i write the field, it shows like interrogant (?)

If i do a Php file without CI, and i print the field its correct.

I tried to change the file database.php with the fields char_set and dbcollat but not works.

Anyone can help me? please.

Thanks you

You should be using a COLLATION of utf8_unicode_ci or utf8_general_ci - CI doe's not understand the ut8mb4 encoding.

Thank you!

I found the solution but I need to do it better.

The solution is before to execute the query put:

$this->db->query('SET NAMES ut8mb4');

It works, but i need to for all application.

I'm thinking to create a hooks.

What you think?

Many thanks!!

Or do it in a MY_Controller

Theme © iAndrew 2016 - Forum software by © MyBB