摘要:
	 
	    SQL的WHERE子句中包含多个AND和OR
	 示例:
	 
	    SQL解析器在处理操作时会优先处理and操作:
	     假如有表product字段如下:id、product_id、product_price、product_name,现在要查找产品号为100或者101,并且价格大于200的商品,程序员可能会这样写:           
	
	
		
			
					select * from product where product_id = 100 or product_id = 101 and product_price > 200  | 
			
	    上述代码中,SQL解析器首先进行and 的操作,最后就成了这个意思:查找产品号为101且价格大于200或产品号为100 的商品。
	 添加圆括号即可:
					select * from product where (product_id = 100 or product_id = 101) and product_price > 200  | 
			
	 sql注入中的万能密码一般都会多加几个or,username' or 1=1 or 1=1 --+
The End


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)