tags:

views:

57

answers:

2

Here is how I read the data:

<?php
$id = $_GET["id"];
$number = mysql_real_escape_string($id);
$result = mysql_query('SELECT * FROM `mystory` where `id` = ' . "$number" . ' LIMIT 1');

$row = mysql_fetch_assoc($result);
echo $row['story'];
?>

The data is encoded as utf8_bin. Insted of ı PHP outputs ?

Why is that? What I'm doing wrong here?

+12  A: 

You need to make sure that your connection to the database us in UTF-8 as well. You can do that this way:

mysql_query("SET NAMES utf8");

Also make sure that you are telling the browser that it is UTF-8:

header("Content-type: text/html; charset=utf-8");
Daniel Egeberg
A: 

I am use all this operations:

mysql_query ('SET NAMES utf8');
mysql_query ('SET CHARACTER utf8');
mysql_set_charset ('utf8', $LINK);
Alexander.Plutov