That won't match because of the (potential) extra characters in
user_input_string. Imagine user_input_string is "web2py python web
framework" and the keyword in the database is "%python%".

On Apr 14, 1:51 pm, mdipierro <[email protected]> wrote:
> I usually do
>
> db(db.name.like('%'+user_input_string+'%')).select()
>
> On Apr 14, 6:51 am, AchipA <[email protected]> wrote:
>
> > Yes, that syntax would cover it (not sure how obvious it would be to
> > newbies, though).
>
> > Massimo: the result should be something like "user input string" LIKE
> > table.keyword_column
>
> > On Apr 13, 3:30 pm, Wes James <[email protected]> wrote:
>
> > > On Sat, Apr 11, 2009 at 11:20 PM, mdipierro <[email protected]> 
> > > wrote:
>
> > > > I do not understand. Can you make an example?
>
> > > > On Apr 11, 5:36 pm, AchipA <[email protected]> wrote:
> > > >> what would be the reverse of that ? if the field is the substring we
> > > >> want to locate ? I have a solution but it's ugly/hackish so I'm open
> > > >> to suggestions :)
>
> > > >> On Apr 10, 6:13 pm, mdipierro <[email protected]> wrote:
>
> > > >> > db(db.name.like('%alex%)).select()
>
> > > I think he wants something like:
>
> > > db(~db.name.like('%alex%')).select()
>
> > > -wj
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" 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/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to