I have a database class but when I use it values from the database are printed without polish chars :(
Gra�yna
it should be
Grażyna
In mysql database Collation is utf8_polish_ci
How can I solve this problem?
<?php
class Baza {
private $link;
private $host, $username, $password, $database;
public function __construct($host, $username, $password, $database){
$this->host = $host;
$this->username = $username;
$this->password = $password;
$this->database = $database;
$this->link = mysql_connect($this->host, $this->username, $this->password)
OR die("Problem z połączeniem z bazą.");
mysql_select_db($this->database, $this->link)
OR die("Problem z wyborem bazy.");
return true;
}
public function query($query) {
$result = mysql_query($query);
if (!$result) die('Niepoprawne zapytanie: ' . mysql_error());
return $result;
}
public function __destruct() {
mysql_close($this->link)
OR die("Problem z odłączeniem się!");
}
}
?>