I could be able to save emoji into mysql with utf8mb4_unicode_ci collation. (Also can see in phpmyadmin). But when I run a query with php (Codeigniter), I get a single question mark (?) instead of emoji. Any idea?

My query:
$query = $this->db->query("SELECT * FROM emoji");
Or even:
$query = $this->db->query("SET character_set_client=utf8mb4");
$query = $this->db->query("SELECT * FROM emoji");
Any idea?
I forgot to add these two lines:
$query = $this->db->query("SET character_set_connection=utf8mb4");
$query = $this->db->query("SET character_set_results=utf8mb4");
Now, it works fine.
Please note that this is a bug tracker and in the future, post your questions on our forums instead.
Btw why do you change the character set manually instead setting in the config?
@AdaLiszk That's a good idea. I'm going to try.
Thanks.
Most helpful comment
Please note that this is a bug tracker and in the future, post your questions on our forums instead.