From d8eace10681204b798df427fc469c1567e6d598e Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 18 Mar 2006 00:37:53 +0000 Subject: [PATCH] Fixing set_condition() so it now actually works --- api.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/api.php b/api.php index 4e7a2c5..748763b 100644 --- a/api.php +++ b/api.php @@ -300,11 +300,7 @@ class API */ function set_condition($condition = '') { - if ($condition != '') - { - $this->condition = $condition; - } - else if (sizeof($condition) > 0) + if (sizeof($condition) > 0) { $this->condition = ''; @@ -312,15 +308,19 @@ class API { if (!$this->values["$field"]) { - trigger_error('The specified field `' . $field . . '` for the condition could not be found as it is not set', E_USER_WARNING); + trigger_error('The specified field `' . $field . '` for the condition could not be found as it is not set', E_USER_WARNING); continue; } - $condbits[] = "$field = " . $this->prepare_field_for_sql($name); + $condbits[] = "$field = " . $this->prepare_field_for_sql($field); } $this->condition = implode(' AND ', $condbits); } - else + else if ($condition != '') + { + $this->condition = $condition; + } + else { foreach ($this->fields AS $name => $options) { -- 2.22.5