--- 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
_____


James D. Keeline
http://www.Keeline.com  http://www.Keeline.com/articles
http://Stratemeyer.org  http://www.Keeline.com/TSCollection

http://www.ITeachPHP.com -- Free Computer Classes: Linux, PHP, etc.
Spring Semester Begins Jan 31 -- New Classes Start Every Few Weeks.


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