From 7e2553646c27cae8baaca1cc5c13d980661b5d90 Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Tue, 2 Apr 2024 18:13:02 -0400 Subject: finish profile directory (mostly) --- src/web/core/database.php | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/web/core') diff --git a/src/web/core/database.php b/src/web/core/database.php index 81352a9..e9b8109 100644 --- a/src/web/core/database.php +++ b/src/web/core/database.php @@ -46,6 +46,8 @@ class DatabaseQuery { if (!$this->where) { $this->where = TRUE; $this->query .= "WHERE "; + } else { + $this->query .= "AND "; } $this->query .= "$cond "; return $this; @@ -85,6 +87,8 @@ class DatabaseQuery { if (!$this->where) { $this->where = TRUE; $this->query .= "WHERE "; + } else { + $this->query .= "AND "; } if (empty($array)) { $this->query .= "FALSE\n"; @@ -95,16 +99,6 @@ class DatabaseQuery { return $this; } - public function and() { - $this->query .= "AND "; - return $this; - } - - public function or() { - $this->query .= "OR "; - return $this; - } - public function join($table, $on, $type = 'LEFT') { $this->query .= "$type JOIN $table ON $on\n"; return $this; -- cgit v1.2.3-freya