I cannot read utf8_persian_ci. why?

Hi ,
I read all posts about reading and writing on MySQL database, and do all setting for utf8.
but my kodular app doesn’t work correctly. it shows ??? for text.
i read data from data base with php file via web module.
these are my picture from database,php file, codes and result.
please help me to solve it

Did you do it on your database and on the table, besides the field?

ALTER DATABASE <database_name> CHARACTER SET xxxxxxx COLLATE yyyyyyyyy;

ALTER TABLE <table_name> CONVERT TO CHARACTER SET xxxxxxx COLLATE yyyyyyyyy;

yes i did all of them

table2|450x500

thanks for your reply. i found the problem in my web reading php file. i add this two lines:

1)header(‘Content-Type: text/html; charset=utf-8’);

2)mysqli_set_charset($dbc,“utf8”);

It was the first thing to check Then, the PHP script.

thanks , it didn’t work lonely, i add following line in line 13

        mysqli_set_charset($dbc,“utf8”);

In order to be helped quickly: pass in the post what you’ve already done.

Hugs

for reading special language like Persian,Arabic and etc.
1)at first i change collation in database,table and columns to utf8-****-ci from Phpadmin in my Cpanel.
then 2) i add tow lines to my php file for reding database
a)header(‘Content-Type: text/html; charset=utf-8’);
b)mysqli_set_charset($dbc,“utf8”);

in places that showed befor

1 Like

All this information are in the post above. :point_up:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.