Store Arabic text in mysql database using php

后端 未结 4 1180
终归单人心
终归单人心 2020-12-17 05:00

I am trying to store some Arabic data in a mysql database I have set the html document charset to be \'utf8\'



        
4条回答
  •  遥遥无期
    2020-12-17 05:47

    You may try this. It should work

    , , , );
    
    if(!$conn){
        die("could not connect: ".mysqli_connect_error());
    }else{
        mysqli_query("SET character_set_results = 'utf8', character_set_client = 'utf8', character_set_connection = 'utf8', character_set_database = 'utf8', character_set_server = 'utf8'", $conn);
    }
    ?>
    

提交回复
热议问题