Home Backend Development PHP Tutorial Multiple condition combination query (1)_PHP tutorial

Multiple condition combination query (1)_PHP tutorial

Jul 21, 2016 pm 04:06 PM
one exist Multiplex yes However Lack

Usually when we develop the system, we will definitely not be short of query terms. However, often one condition cannot meet the user's requirements. At this time, we should set up multiple conditions to combine, so that users can more conveniently select the query conditions when querying. Quickly find the records they satisfy.
Now we assume that we develop a customer order system for a watch company. There are customer order numbers, categories, names, quantities, prices and other information. We will not list the information one by one here. Orders The table is as follows:
Order number (ID) Category (TYPE) Name (NAME) Quantity (QTY) Price (PRICE)
001 Movement Movement 1 100 150
001 Case Case 1 1000 60
001 Watch strap 1 500 70
002 Movement movement 2 200 40
002 Case Case 2 300 53
002 Watch strap 2 400 46
Now we imagine that Build a query system that allows users to quickly query based on order number, category, price, or a combination thereof. The code is as follows:
The following part is a form that displays query conditions


$linkstr=mysql_connect("localhost","root","sa"); > ?>



Multiple condition combination query< / center>







< ; /tr>

  
  
  
  
  


the category is


  
  
价格位在  
的配件  
  
  
  
  
  
  
  
  
  
  
 

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/315376.htmlTechArticle平常我們在開發系統時,一定不會缺少查詢弁?然而往往算個條件是無法滿足用戶的要求的,這時我們就應該設置多重條件進行組合,讓用戶查詢...
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

Repo: How To Revive Teammates
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

The first choice for CS players: recommended computer configuration The first choice for CS players: recommended computer configuration Jan 02, 2024 pm 04:26 PM

1. Processor When choosing a computer configuration, the processor is one of the most important components. For playing games like CS, the performance of the processor directly affects the smoothness and response speed of the game. It is recommended to choose Intel Core i5 or i7 series processors because they have powerful multi-core processing capabilities and high frequencies, and can easily cope with the high requirements of CS. 2. Graphics card Graphics card is one of the important factors in game performance. For shooting games such as CS, the performance of the graphics card directly affects the clarity and smoothness of the game screen. It is recommended to choose NVIDIA GeForce GTX series or AMD Radeon RX series graphics cards. They have excellent graphics processing capabilities and high frame rate output, and can provide a better gaming experience. 3. Memory power

Multiple inheritance in PHP Multiple inheritance in PHP Aug 23, 2023 pm 05:53 PM

Inheritance: Inheritance is a fundamental concept in object-oriented programming (OOP) that allows classes to inherit properties and behavior from other classes. It is a mechanism for creating new classes based on existing classes, promoting code reuse and establishing hierarchical relationships between classes. Inheritance is based on the concept of "parent-child" or "superclass-child" relationship. The class that inherits from it is called a super class or base class, while the class that inherits from a super class is called a subclass or derived class. Subclasses inherit all properties (variables) and methods (functions) of their superclass, and can also add their own unique properties and methods or override inherited properties and methods. Inherited types In object-oriented programming (OOP), inheritance is a basic Concept that allows classes to inherit properties and behavior from other classes. it promotes

Recommended minimum CPU suitable for 1150 motherboard Recommended minimum CPU suitable for 1150 motherboard Jan 04, 2024 pm 09:22 PM

When choosing the lowest-end central processing unit (CPU), it's important to balance affordability with basic needs. For users using 1150 motherboards, choosing a suitable minimum configuration CPU can meet the needs of daily office work, web browsing and light entertainment. This article will recommend several suitable CPUs for you in terms of performance, price, power consumption, and scalability. Among the selections of the lowest-performance CPU, performance is an important consideration. For general office and light entertainment users, a quad-core processor is enough to meet the needs. Intel's i3 series and PentiumG series are both good choices. The i3 series has higher performance and larger cache, suitable for handling multi-tasking and multi-threaded applications. The PentiumG series is

What is NEAR Protocol Coin? What are the characteristics of NEAR Protocol coins? What is NEAR Protocol Coin? What are the characteristics of NEAR Protocol coins? Mar 04, 2024 pm 11:20 PM

NEARProtocol: A scalable, user-friendly blockchain platform NEARProtocol is a blockchain platform using sharding technology designed to address the challenges faced by blockchain technology in terms of scalability, user-friendliness, and security. It provides developers with an efficient and user-friendly platform that enables them to easily build and deploy decentralized applications (dApps). NEARProtocol is designed to lower the barriers to blockchain development while providing a high degree of efficiency and security. By adopting sharding technology, NEARProtocol can better handle large-scale transactions and provide users with faster transaction confirmation times. Overall, NEARProtocol is designed to provide

Detailed introduction on which one is better to use on old computers, win10 or win7 Detailed introduction on which one is better to use on old computers, win10 or win7 Dec 31, 2023 am 08:37 AM

For old computers, they will definitely adapt to more stable and old systems for operation. Many users are curious about which one is better for old computers, win10 or win7. For this reason, we have brought a detailed introduction to help you choose between old computers. system. Which one is better, win10 or win7? Answer: For old computers, win7 is better. We need to frame a time range for the old computers here. Generally speaking, computer models within 10 years can use win10. But if you have an old computer, then the editor recommends using the win7 system, otherwise you may encounter some faults or problems. Comparative evaluation of win10 and win7: 1. Find two old computers, the hardware configuration is the third generation Core i5 mobile processor, 4g memory

What causes the problem of win110xc0000142? What causes the problem of win110xc0000142? Jan 01, 2024 pm 10:41 PM

When we open software or games, the 0xc0000142 error code may appear, causing the problem of being unable to run. At this time, some users want to know what is missing in win110xc0000142. In fact, it is mainly missing the necessary dll components. What is missing in win110xc0000142? Answer: It is missing the dll component. We can fix it through the following methods: Method 1: 1. First, we press "win+r" on the keyboard to open the run. 2. Then enter "cmd" and press Enter to open the command prompt. 3. Then enter "for%1in(%windir%\system32\*.dll)doregsvr32.exe/s%1" and

What is the number of pins in the Antec 650 power supply motherboard cable interface? (Antec 650 power supply wiring diagram) What is the number of pins in the Antec 650 power supply motherboard cable interface? (Antec 650 power supply wiring diagram) Jan 03, 2024 am 10:46 AM

How many pins does the Antec 650w motherboard cable have? The power cable of the Antec 650W power supply motherboard is usually 24 pins, which is the largest power interface on the motherboard. Its function is to connect the motherboard and power supply to provide power to the motherboard and other system components. In addition, the Antec 650W power supply may also include other types of power interfaces, such as CPU8pin, PCIe6+2pin, etc., for connecting other components such as the CPU and independent graphics cards. Motherboard routing tutorial Motherboard routing is the process of connecting circuits between various electronic components when designing a motherboard. In this process, factors such as circuit stability, signal transmission speed and accuracy need to be considered. When routing wiring according to the circuit diagram, pay attention to the layout and select appropriate line width and distance to avoid

Is kvr800d2n6 compatible with DDR3? (Does kvr800d2n6 provide 4GB version) Is kvr800d2n6 compatible with DDR3? (Does kvr800d2n6 provide 4GB version) Jan 09, 2024 pm 10:33 PM

Can kvr800d2n6 be used with ddr3? No. 1. Because kvr800d2n6 is a DDR2 memory module, and DDR3 is another type of memory module, the two are not compatible. 2. Although the slot shapes of DDR2 and DDR3 are the same, there are differences in voltage, timing, transmission rate, etc., so different types of memory modules cannot be interoperable. kvr800d2n6 is a memory stick of several generations. When rewriting the content, the language needs to be changed to Chinese without changing the original meaning. kvr800 When rewriting the content of the memory, the language needs to be changed to Chinese without changing the original meaning (DDR2). Memory The main frequency is 800mhz. kvr800d2n62g is Kingston KVR800

See all articles