Unable to Store Arabic in MYSQL database using PHP

前端 未结 3 1692
一整个雨季
一整个雨季 2021-01-19 11:28

I have been trying to find a solution for past few hours but unable to do so. I have tried each and every possible solution on the Internet and this forum but nothing seems

3条回答
  •  渐次进展
    2021-01-19 12:19

    i wasn't try in Arabic language but i was tried my code in my last project site, the site was available in multi languages. you may just add php function urlencode for save content in database and for retrieving data content use urldecode function.

    $content=urlencode($_POST["content"]);
    
    echo $content;
    $sql="update home set content='$content'";
    

    for retrieve/print

    echo urldecode($data['content']);
    

    or if you don't want this just change column collation type "UTF8_GENERAL_CI"

提交回复
热议问题