I have Database settings as UTF8 GENERAL CI
as collation for my table. But when I try to output using the following PHP code, Question marks show up in place of UTF characters (I am trying to print Regional language characters)...
Following is my code:
<?php
class Article implements JsonSerializable{
private $id;
private $title;
private $content;
public function getId() {
return $this->id;
}
public function getTitle() {
return $this->title;
}
public function getContent() {
return $this->content;
}
public static function getById($id) {
$db = newMysqli ();
$query = "select * from articles where _id=?";
$stmt = $db->prepare ( $query ) or dieOnError ( $db );
$stmt->bind_param ( "i", $id ) or dieOnError ( $db );
$stmt->execute () or dieOnError ( $db );
$member = new Article();
$stmt->bind_result ( $member->id, $member->title, $member->content);
$stmt->fetch () or dieOnError ( $db );
$stmt->close ();
return $member;
}
public function jsonSerialize(){
return get_object_vars($this);
}
}