Here is how I read the data:

$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?

Accepted Answer

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");
Written by Daniel Egeberg
This page was build to provide you fast access to the question and the direct accepted answer.
The content is written by members of the community.
It is licensed under cc-wiki