fields}\nFROM {$this->from}\nWHERE {$this->where}"; if ($this->group) { $query .= "\nGROUP BY {$this->group}"; } if ($this->order) { $query .= "\nORDER BY {$this->order}"; } if ($this->having) { $query .= "\nHAVING {$this->having}"; } if ($this->limit) { $query .= "\nLIMIT {$this->limit}"; } return $query; } public function execute() { $query = $this->getQuery(); return sqlQuery($query, $this->data, $this->types); } public function addData($data) { $this->data = array_merge($this->data, $data); } }