문제

I have a problem on reading Arabic language, when I read arabic text it displayed as a question marks like that

���� ����

Although my php page encoding as Utf8.

And all the table in my database collation Utf8_general_ci.

What should I do ?!!

도움이 되었습니까?

해결책

you must set charset in first connect with mysql through this query:

SET CHARACTER SET utf8

for example in mysqli functions

$MySQL_Handle = mysqli_connect(HOSTNAME,DATABASE_USERNAME,DATABASE_PASSWORD,DATABASE_NAME) or die ( mysqli_error($MySQL_Handle) );

$sSQL= 'SET CHARACTER SET utf8';

mysqli_query($MySQL_Handle,$sSQL) or die ('Can\'t charset in DataBase');

this action need before insert and before select.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top