Inserting special characters into the database |
Hello,
I want to insert special characters into the database with builder. For example: ???? When I send a query these special characters ??? as added to the database. What can I do for it? I am using the utf8mb4 character set in the database. The problem is not in the database. The DB Builder neutralizes these characters.
Thank you for answering.
I created a form where users write messages. Special characters such as a smile are written in this form field with the mobile phone. Unfortunately, while these special characters are being written to the database, they are being disabled. I am using utf8mb4 as the database character set. There is no problem with the database. The problem is that the db-builder neutralizes these characters. I'm writing sample code. You can try by typing special characters such as smile with your mobile phone where it says ****. Please see the picture. (Sorry about my bad English.) PHP Code: //$mesaj_post = trim($this->request->getVar('mesaj_post'));
@mktek,
What version of CI are you using? Is it up to date? Have you tried using query binding (https://codeigniter.com/userguide3/datab...y-bindings) to see if that works better for you.
Make sure your using character set utf8 and collation utf8_unicode_ci for the database.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
Finally I found the cause of the problem.
I made the necessary arrangements in the database. I used utf8mb4 as a character set. Database change was not enough. The following changes were required in the Config / Database.php file: PHP Code: //Old value: Thanks @InsiteFX, @php_rocs |
Welcome Guest, Not a member yet? Register Sign In |