I want to put search box in my website that put a keyword in search box and give us feedback according to the keyword. does it connect with the database? please give me a suitable example.

What do you want, you can incorporate Google CSE relatively easy.

You seem to be posting very general questions asking for code and examples in various threads. You will find that you will get more help if you try first, then post relevant code you are having trouble with and include specific questions regarding your problem.

And I would also recommend you take a look at google's CSE as well.

No, it does not connect with database ... just a random response is needed.