1

here this is my PDO Class

class Database{

    public $isConn;
    protected $datab;

//connect to db
public function __construct($username = "root" , $password = "" , $host = "localhost" , $dbname = "job" , $options =[ ]){
    $this->isConn = TRUE;
    try{

        $this->datab = new PDO("mysql:host={$host};dbname={$dbname};charset=utf8",$username , $password ,$options);
        $this->datab->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
        $this->datab->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);


    } catch ( PDOException $e ){

        throw new Exception($e->getMessage());


    }`enter code here`


}

Anybody please help , my database values are Japanese then i want to output Japanese word. how i change this code for this ?

  • Please provide `SHOW CREATE TABLE` for that table that in involved. – Rick James May 28 '17 at 02:32
  • Do you have any symptoms of it not working correctly? If so, this may provide an answer: http://stackoverflow.com/questions/38363566/trouble-with-utf8-characters-what-i-see-is-not-what-i-stored – Rick James May 28 '17 at 02:33

0 Answers0