if ($u = $this->getRequestParameter('username')) { $u = "'%{$u}%'"; $query->addWhere('u.username LIKE '.$u); } if ($e = $this->getRequestParameter('email')) { $e = "'%{$e}%'"; $query->addWhere('u.email LIKE '.$e); }