多条件查询,提交的空值(条件)怎么办

WBOY
Release: 2016-06-13 12:34:21
Original
907 people have browsed it

多条件查询,提交的空值(条件)怎么处理
表1里有品牌,年限,车型
board(BMW,ford,aodi)
year(2011,2012,2013)
type(car,suv,mpv)

我做了三个下拉菜单,用户搭配选择查询
1,选了board里的BMW和year里的2013,但第三个type没选,

但在做的时候type字段就会发送空,查询时就等于
board='BMW'AND year="2013" AND type='' 
我要实现 不选择的字段IS NOT NULL就是BMW和2013的所有车型,
board='BMW'AND year="2013" AND type is not null

或者

board='BMW'AND year="2013"
这个怎么做,

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!