On the TeenCoderz.com forums today there's a new tutorial showing you how to create a simple AJAX/PHP instant MySQL search.
Not anymore. Imagine if you could search that DB, and display the relevant result the very second that your user presses a key. Instantly give them what they want without ever having to reload the page, or wait to be transferred to another "results" location. That is what this tutorial is going to show you how to do.
Ok, first off I'll explain exactly what this tutorial is going to show you. We all know how to make a simple form that searchs a MySQL DB and displays the results, and if we don't then we should go read some of the many beginner PHP tutorials located on this site. The problem is that the script can be bulky, requires either two seperate files, or a bunch of POST checking, and is almost always going to make the user sit around and wait for it to load.
They give you all the code and how to piece it all together - you'll be up and running in minutes after reading (with a few minor changes, I'm sure).
The script takes in a search term from the form and, using AJAX to make the query, calls the PHP script to pull the info from the DB, which returns the data back in simple links to the waiting Javascript. This is a good little intro to how the whole AJAX/PHP interface works...




