K
K
kot-airplane2016-10-12 21:22:39
PHP
kot-airplane, 2016-10-12 21:22:39

How to write icons to the database?


Dh9Xhw6Pmb8.jpg
Sparsed posts from VK, but if there are some icons in the text of the message, they are not written to the database, for example:
text='".$text."',
And all the same, the text that is before the icons is recorded, it breaks off at this point. Some icons work fine. Tried addslashes - does not help. Field in DB in utf8_general_ci

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Melkij, 2016-10-12
@melkij

First, use normal prepared statements, or at least keep PDO emulation on. They won't cut anything. Real prepared expressions will generally go as they are in binary form, emulation in PDO will do everything possible for correct transmission.
Second - use utf8mb4 encoding. If you think that utf8 in mysql and utf8 in the rest of the world are the same, then you are wrong. All over the world in utf8 up to 4 bytes per character, in mysql - only 3. Here are all sorts of emoticons fashionable today in this 4 bytes and live.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question