Multi-condition combined query (1)

Source: Internet
Author: User
Normally, when developing a system, there will be no lack of query records? However, when calculating a condition cannot meet the user's requirements, we should set multiple conditions for combination to make it easier for users to select query conditions, quickly find the records they meet. now let's assume that we have developed a customer order system for a watch company, which includes the customer order number, category, name, quantity, price, and other materials. we will not list the materials here ,. the order table is as follows: order number (ID) category (TYPE) name (normally we do not need to query the category when developing the system? However, when calculating a condition cannot meet the user's requirements, we should set multiple conditions for combination to make it easier for users to select query conditions, quickly find the records they meet.
Now let's assume that we have developed a customer order system for a clock company, which includes the customer order number, category, name, quantity, price, and other materials. here we will not list the materials in one column. The order table is as follows:
Order No. (ID) category (TYPE) NAME (NAME) quantity (QTY) PRICE (PRICE)
001 movement: 1 100 150
001 case 1 1000 60
001 strap, strap, 1 500, 70
002 movement 2 200 40
002 case 2 300 53
002 strap 2 400 46
Now we want to create a query system so that users can quickly query by order number, category, price, or combination. the code is as follows:
The following section is a form that displays query conditions.

 
$ Linkstr = MySQL (the best combination with PHP) _ connect ("localhost", "root", "sa ");
MySQL (best combination with PHP) _ select_db ("cx", $ linkstr );
?>

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.