jQuery+AJAX+PHP+MySQL develops search function without jump or refresh

不言
Release: 2018-07-13 15:39:09
Original
2161 people have browsed it

This article mainly introduces the function of jQuery AJAX PHP MySQL development search without jump and refresh. It has certain reference value. Now I share it with everyone. Friends in need can refer to it

Knowledge points : ajax submits the form, php queries the database, php returns the json array, and javascript traverses and outputs the json array

Demonstration:

1. When no keywords are entered in the form," is returned Please enter keywords..."

jQuery+AJAX+PHP+MySQL develops search function without jump or refresh

#2. When the keyword query entered in the form fails,"No results"## will be returned.

jQuery+AJAX+PHP+MySQL develops search function without jump or refresh

##3. When the keyword query entered in the form has results, the results will be returned.

jQuery+AJAX+PHP+MySQL develops search function without jump or refresh

Form page

index.html

nbsp;html>   AJAX搜索     

Copy after login

AJAX+PHP+MySQL搜索


Server

search.php

Copy after login
Database configuration

config.php

Copy after login
Database structure

jQuery+AJAX+PHP+MySQL develops search function without jump or refresh##Database name: test

Table name: datalist

Fields: id, title, url
Field analysis:
id - self-increment ID
title - title
url - page link

The above is the entire content of this article, I hope it will be helpful to everyone Learning will be helpful. For more related content, please pay attention to the PHP Chinese website!

Related recommendations:

About the operations of extend, mixins, extends, components, install in vue Installation of PHP And an introduction to integrating with apache

The above is the detailed content of jQuery+AJAX+PHP+MySQL develops search function without jump or refresh. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!