Possible Duplicate:
UTF-8 all the way through
So I saved some data in a mysql database and its stored there with "umlauts". When I'm speaking of umlauts I mean these German letters: ö, ä, ü and their capitalized pendants.
So now I execute a query via PHP, something like this:
$query = "SELECT * FROM tcms_references WHERE id =".$row->id;
$erg = mysql_query($query);
$rowt = mysql_fetch_object($erg);
foreach($row as $x) {
echo $x
}
Now, there is no German word like "Baumfällung" saved in my database. The PHP query is executed and presented on the screen as "Baumfällung".
My question: Where can I set UFT-8 as a Standart in PHP? Is there any function or something?
mysql_*
functions in new code. They are no longer maintained and are officially deprecated. See the red box? Learn about prepared statements instead, and use PDO or MySQLi - this article will help you decide which. If you choose PDO, here is a good tutorial.