mysql 多条件查询有关问题

WBOY
Release: 2016-06-13 11:42:56
Original
795 people have browsed it

mysql 多条件查询问题
"select * from subcatalog WHERE name LIKE '%$keywords%' and catalog = $catalog ORDER BY rank $rank limit $pages, $rows"


上面的语句,怎么可以做到当 $catalog 这个值为空的时候,可以搜索其他的数据,现在这里catalog = $catalog 为空的时候列表就没有东西出来了 

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