// I'm using adodb public function FetchFields() { $rowNumber = $this->rs->CurrentRow(); $row = $this->rs->FetchRow(); $this->rs->Move($rowNumber - 1); $fields = Array(); foreach (array_keys($row) as $v) { if (!is_numeric($v)) { $tmpObj = new FetchFields(); $tmpObj->name = $v; $fields[] = $tmpObj; } } $this->name = $fields; $this; } class FetchFields { public $name; public function FetchFields() {} public function __set($prop_name,$prop_value) { $this->name[$prop_name] = $prop_value; } public function __get($prop_name) { if (isset($this->name[$prop_name])) { $prop_value = $this->name[$prop_name]; return $prop_value; } else { return false; } } }