dbname = $name; $this->dbid = $v; } public function __construct_id ($id, $table, $nf) { $v = DB::QueryResultValue("SELECT $nf FROM $table WHERE id = ?(id)", $id); $this->dbname = $v; $this->dbid = $id; } public function __construct ($name_or_id, $table, $nf = 'name') { if (is_numeric($name_or_id)) { $this->__construct_id($name_or_id, $table, $nf); } else { $this->__construct_name($name_or_id, $table, $nf); } } public function getID () { return $this->dbid; } public function getName () { return $this->dbname; } } ?>