I am trying to implement searching functionality in my website. I have following type of data.
Title Descr
----- -----
World News World news, news from across the world, all world news events covered
World Sports World sports news, for all of sports people, sports is a famous world
Now I want if the user searched for "world news" then result will be displayed like following,
World News (title)
... all world news events covered ... (descr)
Basically I want to display some phrases on random basis. Like when user searching for "world news" then some times he'll get result like above and sometimes like below,
World News (title)
World news, news from across the world, ... (descr)
Please tell me how we can get this kind of functionality using mysql queries, or if its not directly possible through mysql queries then how is it possible using PHP.
Google does the same thing sometimes, google displayes phrases form the middle and sometimes it displayes the starting text.
Thanks.