Create an ajax keyword data search implementation by jquery _ jquery-js tutorial

Source: Internet
Author: User
Tags db connect php database
We often need to enter keywords on the front-end page to search for data. This has become a habit. Today we will share with you how to use jQuery, MySQL, and Ajax to create simple and attractive Ajax searches, do not miss out if you are interested. In the web development process, we often need to enter keywords on the front-end page for data search. We usually use the search method to display the search results on another page, this method is not the most suitable method for building a high-performance website. Today I will share with you howUse jQuery, MySQL, and AjaxCreate a simple and attractive Ajax search. This is the second tutorial on practical use of the jQuery project following "create a practical data transmission mode pop-up form with jquery, we hope that you can flexibly use the project based on your actual situation.

Click search to display all results by default.

Enter the search result displayed after

Search result displayed after p is input

No search term Page found

Demo-click the search button below to search for Data

The file structure mainly uses several file index. php homepage dbcon. php database connection file search. php search processing page

The first step is to create an ajax_search database, and then create an ajax_search table.

The Code is as follows:


Create table 'ajax _ search '(
'Id' int (11) not null auto_increment,
'Firstname' varchar (50) not null,
'Lastname' varchar (50) not null,
'Age' int (11) not null,
'Hometown 'varchar (50) not null,
'Job' varchar (50) not null,
Primary key ('id ')
) ENGINE = InnoDB default charset = utf8 AUTO_INCREMENT = 5;


HTML: index. php -- main page of the program

The Code is as follows:






Ajax Tutorial: Create an ajax search using jquery and mysql

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.