Welcome Guest, Not a member yet? Register   Sign In
Inserting special characters into the database
#3

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'));    
    
$mesaj_post "smile **** smile";
        
    
$insert_data = array(
        
'mesaj' => $mesaj_post,
        
'time' => time()
    );

    
$builder $this->db->table('table');
    
$result $builder->insert($insert_data); 


Attached Files Thumbnail(s)
   
Reply


Messages In This Thread
RE: Inserting special characters into the database - by mktek - 05-25-2021, 06:14 AM



Theme © iAndrew 2016 - Forum software by © MyBB