Allowing your users to search through data within your web application is a basic principle. This recipe will show you how to create a fast and efficient search feature that uses jQuery and AJAX with a PHP and MySQL backend.
This recipe not only requires that you have a running web server that has PHP5, but you will also need a MySQL server that is ready to accept connections from PHP scripts.
Learn how to create a search feature from scratch, which will show you valuable jQuery principles in action, by performing the following steps:
We need to create a database and a table to store the data that the users will be able to search. Create a database named
jquerycookbook
on your database server, and use the following SQL code to create and populate a table with some data:USE `jquerycookbook`; CREATE TABLE IF NOT EXISTS `stationary` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `title` varchar(128) NOT NULL, PRIMARY KEY (`id`) )...