You are here: Re: Search DB by more than one word « PHP Programming Language « IT news, forums, messages
Re: Search DB by more than one word

Posted by Gene Kelley on 01/12/08 02:54

paul814@excite.com wrote:
> On Jan 7, 12:39 pm, paul...@excite.com wrote:
>> On Jan 7, 12:33 pm, "Paul Lautman" <paul.laut...@btinternet.com>
>> wrote:
>>
>>
>>
>>> paul...@excite.com wrote:
<...>
> I think I fixed this by going from this:
> $sql = "SELECT * FROM EDITORIAL WHERE editorialcomments LIKE '$Search
> %' ";
>
> to this:
> $sql = "SELECT * FROM EDITORIAL WHERE editorialcomments LIKE '%$Search
> %' ";
>
> And I think this fixed my initial problem, question

Yep. You got it. I would only add that, for performance reasons, I'd
recommend that the editorialcomments column is being indexed. These
"fuzzy" searches, that use the % in the clause tend to be much slower.
As well as the fact that text (varchar()) columns are slower even if an
explicit clause were used.

--

Gene Kelley
Senior Open Source Software Engineer
Advanced Design Solutions Team
Network Solutions (MonsterCommerce)
Swansea, Illinois, USA
Eugene.Kelley_AT_networksolutions_DOT_com

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация