On Thu, Jan 1, 2009 at 3:12 PM, Felipe Vergara <[email protected]> wrote:
>
> I need some help. I am doing an auto complete that hast to find result from
> a mysql database of some people if the text written in the text box matches
> the name or last name. It works if i only want to find matches with the name
> or indepently the secon name but not with a or of both.

> @inscritos = Inscrito.find(:all,
>         :conditions => ["LOWER(nombre) OR LOWER(apellido) LIKE ?",

I would think that would work if you enclosed your arguments in
parens, e.g.

(LOWER(nombre) OR LOWER(apellido)) LIKE ?

or alternatively

LOWER(nombre) LIKE ? OR LOWER(apellido) LIKE ?

FWIW,
-- 
Hassan Schroeder ------------------------ [email protected]

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to