PHP Combo Box (like in MS Access)

I have a table that is going to grow considerably as the site grows with names of businesses.  I don't think I can realistically put this list of businesses in a <select></select> tag using PHP to grab the names from the database due to the size and potential number of records.  Is there such a thing as a "combo box" in PHP, which will recognize an entry once the user starts typing, without loading the entire database table into the list box first?  I'm just thinking that this could be too taxing on a shared server.  I hope I'm making sense!
ssailerAsked:
Who is Participating?
 
Dave BaldwinFixer of ProblemsCommented:
You can use 'autosuggest' which brings up possibilities as you type.  http://code.google.com/p/ajax-auto-suggest/  It's really not that much load on a shared server since no one can type fast enough to cause a problem.
0
 
jhheiderCommented:
It wouldn't be in PHP, since that is all server-side dynamism. You'd need some AJAX to respond to the onChange= event of your text input, and send HTTP(S) queries back to a listener on the server. Basically, onChange= you'd want to call http://yourserver/lookup.php?q=$typed_date and do a SELECT * FROM table WHERE field LIKE '{$_GET['q']}%' LIMIT 30 or similar. While the listener is easy, you're probably going to have to look around for the AJAX or write some jQuery to do it.
0
 
ssailerAuthor Commented:
I need to be able to get the results from records in a database, and I didn't see any demos for the auto suggest.  Does this plug-in tap into a database table?
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Dave BaldwinFixer of ProblemsCommented:
This line in autosuggest.js myAjax.makeRequest( url, meth, onSuccessFunc, onErrorFunc ); call 'test.php'.  'test.php' in the demo has a static array to get the info.  You could convert that into a database access.

There are many other demos available with PHP/MySQL code.  https://www.google.com/search?q=ajax+autosuggest+php+mysql
0
 
Ray PaseurCommented:
Make a Google search for jquery autosuggest with php/mysql and see if the results look good.  They did to me, but I don't have time to test the solutions right now.  HTH, ~Ray
0
 
ssailerAuthor Commented:
Actually, I found an extension at DMX Zone that does exactly what I'm looking for.  It's called the Ajax AutoComplete.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.