Save Data in Arabic in MySQL database

前端 未结 7 1874
我在风中等你
我在风中等你 2020-11-22 14:13

I have changed the charset of the tables and of the column, i get the arabic text as ???? marks in MYSQL database

here is the design of the table

  C         


        
7条回答
  •  北海茫月
    2020-11-22 14:50

    To read ,write and sort Arabic text in mysql database using php correctly, make sure that:

    1. MySQL charset: UTF-8 Unicode (utf8)

    2. MySQL connection collation: utf8_general_ci

    3. your database and table collations are set to: utf8_general_ci or utf8_unicode_ci

    Then, add this code in your php script when you connect to db:

    mysql_query("SET NAMES 'utf8'");
    mysql_query('SET CHARACTER SET utf8');
    

    For more details

提交回复
热议问题