Home >Backend Development >PHP Tutorial > mysql 多条件查询有关问题

mysql 多条件查询有关问题

WBOY
WBOYOriginal
2016-06-13 12:31:10691browse

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


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

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