From 7093ebd23fdce13c22913b0077ec72394c278632 Mon Sep 17 00:00:00 2001 From: naomiaro Date: Sat, 12 Feb 2011 23:07:28 -0500 Subject: [PATCH] modified to avoid sql error when searching. --- application/models/Users.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/application/models/Users.php b/application/models/Users.php index ee6afc957..8a2574505 100644 --- a/application/models/Users.php +++ b/application/models/Users.php @@ -139,13 +139,15 @@ class User { $sql_type = "type = {$type}"; } - $sql = $sql_gen ." WHERE (". $sql_type.") ORDER BY login"; + $sql = $sql_gen ." WHERE (". $sql_type.") "; if(!is_null($search)) { $like = "login ILIKE '%{$search}%'"; - $sql = $sql . " AND ".$like." ORDER BY login"; + $sql = $sql . " AND ".$like; } + + $sql = $sql ." ORDER BY login"; return $CC_DBC->GetAll($sql); }