Hi,
Thanks for the advice. Looked on mysql.com for advice on REGEXP. Seems 
promising but I can't seem to find the right regexp (I hate them :-()

I might just have to screen the words before I search like james suggested, 
does anyone know where I can get a list of commonly usd words! ;-)

Cheers,

Jord

On Friday 21 September 2001 07:14, you wrote:
> Postfix Users,
>
> I just joined this list a few minutes ago, and already I feel the need to
> try and help out in any way I can. So here goes:
>
> Jord,
>
> Try using REGEXP rather than LIKE. So try something like this:
>
> SELECT * FROM table WHERE keywords REGEXP '%keyword%';
>
> If this does not work I may have the wrong string pattern, if so, do a
> search on REGEXP on the mySQL manual: http://www.mysql.com/doc/. I'm sure
> they have examples on using REGEXP.
>
> Good Luck.
>
> -----Original Message-----
> From: Jordan Elver [mailto:[EMAIL PROTECTED]]
> Sent: Friday, September 21, 2001 9:03 AM
> To: MySQL Mailing List; PHP DB Mailing List
> Subject: [PHP-DB] Searching MySQL using LIKE
>
> Hi,
> I'm cross posting this because it's applicable to both list ;-)
>
> I have a table which contains a field called Keywords. The field typically
> contains something similar to this "rubbish bins trash"
>
> I want to search this field and I'm having trouble. If someone enters "I
> need
> bins" then the the result will not be found.
>
> I started off by using SELECT * FROM table WHERE keywords LIKE '%keyword%',
> but that doesn't work if you type in more than just bins. So then I tried
> splitting the words entered on a space and searching for each of them like
> this SELECT * FROM table WHERE keywords LIKE '%keyword1%' OR keywords LIKE
> '%keyword1%'. But that returns loads of results because a lot of words
> contain "is" or "it" etc.
>
> Can anyone help me with this one, I'm not sure what to try next?
>
> Cheer,
>
> Jord
> --
> Jordan Elver
> Web Developer
> The InternetOne UK Ltd
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
Jordan Elver
Web Developer
The InternetOne UK Ltd

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to