Re: [PHP] Mysql strategy
- From: dotancohen@xxxxxxxxx ("Dotan Cohen")
- Date: Mon, 13 Nov 2006 14:53:00 +0200
On 13/11/06, Chris <dmagick@xxxxxxxxx> wrote:
Dotan Cohen wrote:
> If I have to perform 30 LIKE searches for different keywords in a
> varchar field, which strategy would be recommended:
> 1) 30 searches, one for each keyword
No. Horribly inefficient.
> 2) To select the varchar field from all the rows, and search through
> them with php's array functions?
No. Make the database do the work.
Use full text indexing:
http://dev.mysql.com/doc/refman/4.1/en/fulltext-search.html
Thanks, Chris, but that approach won't work as I don't know all the
values that I'll be searching for at any one time. In fact, I only
know one of them at a time. This is the makeLink function in another
thread that you helped me in.
However, I do see other use of the full-text search functions in my
future! This looks like it could save me quite a bit of work on
another project.
Dotan Cohen
.
- References:
- Mysql strategy
- From: "Dotan Cohen"
- Re: [PHP] Mysql strategy
- From: Chris
- Mysql strategy
- Prev by Date: How do I install a homepage return button
- Next by Date: Re: [PHP] Parsing brackets in text
- Previous by thread: Re: [PHP] Mysql strategy
- Next by thread: Re: [PHP] Mysql strategy
- Index(es):