In message <[EMAIL PROTECTED]>, James
Keeline <[EMAIL PROTECTED]> writes
>
>--- Jer <[EMAIL PROTECTED]> wrote:
>> 
>> Currently, I use LIKE in the query (i.e. WHERE title LIKE '$search').
>> I'm finding that that is too restrictive.
>> 
>> For example, if someone were to search for the title "Me, Myself &
>> Irene", they would actually need to search for "me, myself & irene".
>> If they search for "me myself irene" or "me irene" or "me, myself and
>> irene", the search would come back with nothing.
>> 
>> Is there a better way to search than using LIKE in the query?
>
>
>If you have a very recent version of MySQL you might be able to use "FullText
>Searches".  Otherwise, you should use the split() function to divide the search
>string into multiple words and build up a query which includes each of the
>words in the array generated by split();  You can drop words which you think
>will be confusing.  I'm working now so I can't compose a sample program. 
>Hopefully this will point you in the right direction.
>
>James

Agreed.  When I posted my reply a few minutes ago, I missed the fact
that you were asking for non-contiguous words, because I had just
created a search like the one I suggested.  And it's not fast.

-- 
Pete Clark

http://www.hotcosta.com
http://www.spanishholidaybookings.com




Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to