MySQL 3.23 has full-text search built-in, and it's made for exactly this
situation.  You'll need to create a index of type FULLTEXT:

http://www.mysql.com/doc/M/y/MySQL_full-text_search.html

Of course, the other way to do this is to create another table with the
keysword in it, and a pointer back to the original record, then do a simple
join.  This also gets rid of the 3-term limit.

To answer your question, though, when I have to create flat tables like
that, I use a memo field and tell people that the terms need to be entered
one per line.  This gets rid of the punctation and multiple word problems,
it looks very clear, and it's fairly easy to convert to a more properly
designed structure.

Anyway, check out the full-text search.  It's not as good a full-blown
search engine, but it beats the heck out of LIKE %$searchstring% queries!

Tac


----- Original Message -----
From: "Mike<mickalo>Blezien" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, March 10, 2001 1:23 PM
Subject: Seaching Keywords column


Hello All,

We have a table where keywords will be entered into a column (searchwords),
up
to 3 unique keywords. Then this column will be used in a keywords search
tied to
a Category(a Category has to be selected). The table will have a category
column: category. Basically when a search is done, it will be something like

WHERE category = '$CatSelected' AND searchwords IN '$keyword1'
OR searchwords IN '$keyword2'... etc..

or

WHERE category = '$CatSelected' AND searchwords LIKE "$keyword1%"
OR searchwords LIKE "$keyword1%".... etc...

Now the problems we seem to have is how we should enter the keywords into
the
searchwords column. there can be up to 3. Should they be entered as:
keyword1,keyword2,keyword3 or  keyword1 keyword2 keyword3(as a string). What
would be the best way to do this so that we can do a search on the all the
keywords entered into the searchwords column.

Any suggestion/advise much appreciated.


Mike(mickalo)Blezien
========================================
Thunder Rain Internet Publishing
Providing Internet Solutions that work!
http://www.thunder-rain.com
Tel: 1(225) 686-2002
=========================================















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



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