You are here: Re: Compare every word in paragraph with every row in database « PHP SQL « IT news, forums, messages
Re: Compare every word in paragraph with every row in database

Posted by Tom on 09/26/07 17:21

On Tue, 25 Sep 2007 13:05:08 -0700, blackrosezy@gmail.com wrote...
>
>My problem is I want to compare every word in large paragraph with
>every row in database.But this technique use to much process and slow
>down query performance.e.g.
>
>My paragraph:
>"This is my very very large paragraph"
>
>My table in MySQL contains this keyword :
>
>book
>------------
>this
>------------
>hello
>------------
>car
>------------
>very
>------------
>
>So first I will compare the word 'This' with data in every row
>(book,this,hello,car,very) then following by word 'is','my',..
>
>Is there any better to workaround this problem?
>


The approach I might take would be splitting the words in your paragraph into a
hash array. Then run a SELECT query in your SQL and capture the results into
another array. That way you have an apples to apples comparison. From that point
you can run a "for" loop through one array and compare it to the other.

Tom
--
NewsGuy Takes Usenet Cellular!
Download newsgroup MP3's to your Cell or PDA
Free Trial - http://newsguy.com/cellphone.htm

 

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

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