0
데이터베이스가 UTF8_bin으로 인코딩되어 있습니다. 데이터베이스에서 어떤 것을 울리려고 할 때마다 글자 대신 물음표가 표시됩니다. 누구든지 그 해결책을 알고 있습니까? 나는 UTF8에서 한 단어에 에코를한다면 그것은 괜찮다고 언급하는 것이 중요하다고 생각한다. 문제는 데이터베이스에서 데이터를 가져 오는 것입니다.PHP UTF8 데이터베이스
데이터베이스가 UTF8_bin으로 인코딩되어 있습니다. 데이터베이스에서 어떤 것을 울리려고 할 때마다 글자 대신 물음표가 표시됩니다. 누구든지 그 해결책을 알고 있습니까? 나는 UTF8에서 한 단어에 에코를한다면 그것은 괜찮다고 언급하는 것이 중요하다고 생각한다. 문제는 데이터베이스에서 데이터를 가져 오는 것입니다.PHP UTF8 데이터베이스
다음 단계를 수행했는지 확인하십시오.
-> db collation must be utf8_general_ci
-> then collation of the table with language has to be utf8_general_ci
-> in your php connection script put header('Content-Type: text/html; charset=utf-8');
-> in xhtml head tag put <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-> after selecting the db in the connection script put mysql_query("SET NAMES 'utf8'");
Then check the connection like this,
if(!mysqli_set_charset($conn, 'utf8')) {
echo 'the connection is not in utf8';
exit();
}