I am attempting to implement a search box in my website, my website is based on users logging in and doing things. I would like to be able to type something into the search box, and then display the results in a drop down that comes from this.
This is a duplicate to How to query MySQL Database and display its search results by PHP? , you may think, it is similar, but I want to be able to display the results in real-time as a new letter is entered.
This function is a lot like the facebook search box, where you can search for users.
Thanks, I have tried to be as clear as possible.
EDIT: I have tried to find the results, which I can, but don’t know how to display them in real time. AKA: a select statement, and that finds out if the name contains what was searched. Then an echo to display it.
I believe you are referring to something along the lines of “autocomplete”.
See jQuery UI Autocomplete.
If that’s what you want… you use JavaScript to make an AJAX request each time the user enters something in the input, and then also using JavaScript, display the results.