简体   繁体   中英

PHP MYSQL encoding issue ( Turkish Characters )

core.php

$con=mysqli_connect("localhost","root","","mmogezgini");
header('Content-Type: text/html; charset=utf-8');

gamelisti.php

$result = mysqli_query($con,"SELECT * FROM games");
while($row = mysqli_fetch_array($result))
  {
?>
HTML CODES
<?php echo $row['game_name']; ?>
HTML CODES
<?php }
mysqli_close($con);
?>

i use turkish characters like "ö,ç,ğ,ı" i see these correctly in database but when i select them from database and show with php echo they looks like question mark=(?) my encoding on database utf8_general_ci

  1. Double check your HTML encoding.
  2. http://php.net/manual/en/mysqli.set-charset.php (just after you connect to DB: mysqli_set_charset($con, 'utf8');
  3. Are you using prepared statements? (not related but important).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM