You are setting the local variable $data
in the constructor, but referencing the member $this->data
later. Pick one or the other. I assume you mean to set the member, notice line 2:
function __construct($id) {
$this->data = db::singleton()->query("SELECT * FROM usuarios WHERE id=$id")->fetch();
var_dump($this->data);
$this->data["status"] = $this->textStatus[$this->data["status"]];
}
It also looks like you are accessing db
within the constructor, although this may not be in scope. Please elaborate on the contents of the db.php
file to get an answer to this potential problem.