Auto complete multiple results in textfield from mysql database

I am new in php and ajax. I have search a lot from internet for this problem but in vain. I want to make an auto complete system just like this website: ( My problem is more simple than this website. My requirement is: “When I will enter something in text field, it will show the match results from database. When i will select one of those results then it will show in the same text field. I want to select multiple results and all results will show in the same text field.”

Now my next question is: “how i will handle all these results in php variables and post them to my required file.”

I am so much confused. Please give a simple solution because I am new in php and ajax.

You can see an image to understand my problem on this link: (

I recommend to use an existing library for that (e.g. typeahead) then you have sufficient examples/documentation you can adapt to your system.

I have done with auto complete. Now i am having problem with multiple data show in single text field