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