php, OOP dosent allow me to fetch multilingual content?

Posted by user3138823 on Stack Overflow See other posts from Stack Overflow or by user3138823
Published on 2014-05-28T03:22:19Z Indexed on 2014/05/28 3:24 UTC
Read the original article Hit count: 101

Filed under:
|
|

i have written bellow class for my database connection.

class dbConnection {

protected $dbLink;
public $db_host = "127.0.0.1";
public $db_user = "root";
public $db_pass = "";
public $db_name = "answer";

function connect() {
    try {
        $dbLink = new PDO('mysql:host='.$this->db_host.';dbname='.$this->db_name, $this->db_user, $this->db_pass);
        return $dbLink;
    } catch (PDOException $e) {
        return $e->getMessage();
    }
}

}

but in my databse i have multilingual content ( collection type = utf8_general_ci ). when i try to fetch data it returns ???? instead of real data.

please can any one tell me how can i improve my class to work with multilingual contents.

Thanks.

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql