public function numFields() { if (!isset($this->result)) { throw new Exception('Error: The database result resource is not currently set.'); } return $this->result->numColumns(); }