I have a class with id, keyword and value. I'm fetching data from a table named Setting into the class Setting using
if ($stmt->execute()) {
$o = $stmt->fetchAll(PDO::FETCH_CLASS | PDO::FETCH_PROPS_LATE, "Setting", array('id', 'keyword','value'));
}
When I look at the content of $o I see the following
Array ( [0] => Setting Object ( [id] => id [keyword] => keyword [value] => value [Id] => 1 [Keyword] => AdminMail [Value] => yahoo@yahoo.com ))
My class looks like this
class Setting {
var $id;
var $keyword;
var $value;
function __construct($id,$ke,$va) {
$this->id = $id;
$this->keyword = $ke;
$this->value = $va;
}
public function getKeyword() {
return $this->keyword;
}
public function getValue() {
return $this->value;
}
}
I expect that $o->getValue returns yahoo@yahoo.com but it returns value.
Can someone tell my why "[id] => id [keyword] => keyword [value] => value" appears before the actual output from my table?