diff --git a/classes/Model.php b/classes/Model.php index 43bd82c..23b3fda 100644 --- a/classes/Model.php +++ b/classes/Model.php @@ -617,6 +617,21 @@ class Model extends Object // Adds the WHERE conditionals if ($this->conditions != false) { + $use_id = true; + + foreach ($this->conditions as $column => $value) + { + if (is_string($column) || is_string($value)) + { + $use_id = false; + } + } + + if ($use_id) + { + $this->conditions = array($this->columns['id'] => $this->conditions); + } + $this->sql[] = 'WHERE ' . (is_array($this->conditions) ? $this->generateConditions($this->conditions) : $this->conditions); } diff --git a/jar.php b/jar.php index 26c4865..5c07085 100755 --- a/jar.php +++ b/jar.php @@ -4682,6 +4682,21 @@ class Model extends Object // Adds the WHERE conditionals if ($this->conditions != false) { + $use_id = true; + + foreach ($this->conditions as $column => $value) + { + if (is_string($column) || is_string($value)) + { + $use_id = false; + } + } + + if ($use_id) + { + $this->conditions = array($this->columns['id'] => $this->conditions); + } + $this->sql[] = 'WHERE ' . (is_array($this->conditions) ? $this->generateConditions($this->conditions) : $this->conditions); }