Use dw mx for intra-site search

Source: Internet
Author: User
The post on searching in the production site with dw mx keeps asking questions in the forum, so this tutorial is also available and I hope it will help you.

Intra-site search can be divided into single-parameter (query a field based on one condition) queries and multi-parameter (multiple conditions can be used to query different database fields) queries, you can select "include" as the filtering condition in the simple records set of dw mx for single-parameter query. Then, switch to the "advanced record set" mode. The SQL statement is as follows:

SELECT *
FROM user
WHERE uesr LIKE ''% MMColParam %''

The user is the database table to be queried, the uesr is the field to be queried, and MMColParam is the query variable. When submitting data from the form, the value of the text field is assigned to the variable, % is a wildcard, and LIKE is a logical operator, meaning "similar". It is used to search records containing keywords. The above code is automatically generated by dw mx, which is relatively simple. The following describes how to implement multi-parameter queries, that is, to query multiple database fields and to screen out records that meet the search criteria.

This is my multi-parameter intra-site search using dw mx. You can query records based on multiple conditions.

Instance 1. Search by two conditions

Procedure:

1. Design your database table. In this example, we use the forum table, as shown in the following figure:

The bbs_title field is the post title, and the bbs_uesr field is the subject author. You can search by title or author on the query page.

2. Create a page and save it as HTM or ASP (if ASP code exists). In this example, save it as Search. asp. Insert a form, a text field, and a list menu. The Form method is GET. The corresponding name and value are as follows:

Text domain name description text keywords select List menu, select search conditions first

The list menu settings are as follows:

Page style:

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.