Hello, I am in need of a PHP script that will search a database with articles (with 2 fields : content and numb) and select senteces. I will explain below what exactly it should do :
the script recieves a keyword (using get command) and a variable nr_words.. This keyword can have 1,2...n words .
the script needs to search the database and return sentences(and id of the article from where the sentence has been created).
the sentences need to have at least n/2 words in it (words from the inputed keyword) .
the sentences that have the most words from keyword are rated best .
the sentences should be gathered until the number of words from the variable nr_words are reached or until the script searched the entire database.
after all the sentences are gathered, they should be outputed in the browser, one after another .
Let me give you an example :
keyword=internet business good
good sentences :
I think that internet business are good (3 words out of 3)
Internet is good for business (3 words out of 3)
Programming is a good business (2 words out of 3)
It's good that you are eating (1 word -> we need n/2 = 3/2 = 2 (rounded))
I love internet (1 word -> we need n/2 = 3/2 = 2 (rounded))
I already have the script made by me . My script searches the database for sentences that have the exact keyword :
in our case : internet business good
So it searches for sentences that have exactly this words, one after another .
I hope I explained well what I need . I am a programmer myself (C++) and I can't do this becouse I am not that advance in PHP .
Don't bid high becouse it's not hard for someone who knows how to work with PHP and mysql .
I am going to give you the script (so you will see how the output should look) so you can just modify it .
I will give you a temporary account for the ftp and also acces to the database .
!!! EACH field of the database have 2 fields :
content = this field contains articles . So each content field with the coresponding ID has an article from where the sentences should be collected .
!!! I will pay via moneybookers
happy bidding :D