Home  >  Article  >  Backend Development  >  Multiple condition combination query (1)_PHP tutorial

Multiple condition combination query (1)_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 16:06:221072browse

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:
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