public function getQuery() { $fields = is_array($this->fields) ? implode(",", $this->fields) : $this->fields; $distinct = $this->distinct ? "DISTINCT" : null; $query = "SELECT {$distinct} {$fields} FROM " . $this->table . " " . parent::getQuery(); if (count($this->orderBy) > 0) { $query .= " " . implode(", ", $this->orderBy); } return $query; }
public function getQuery() { $set = array(); foreach ($this->values as $key => $value) { if (is_string($value)) { $value = "'" . $value . "'"; } $set[] = $key . "=" . $value; } $args = implode(", ", $set); $query = "UPDATE " . $this->table . " SET " . $args; return $query . " " . parent::getQuery(); }
public function getQuery() { $query = "DELETE FROM " . $this->table; return $query . " " . parent::getQuery(); }