from('foo', '*');$select->where('ba"/> from('foo', '*');$select->where('ba">

急求php中 select的有关问题

WBOY
Release: 2016-06-13 10:21:01
Original
775 people have browsed it

急求php中 select的问题
//
// SELECT *
// FROM foo
// WHERE bar = "baz"
// OR id IN("1", "2", "3")
//
$select->from('foo', '*');
$select->where('bar = ?', 'baz');
$select->orWhere('id IN(?)', array(1, 2, 3);
上面的案例只是实现或的条件 ,
可是我要求实现 与最后一个条件是或的关系。如 select I from foo where bar ="baz" or (id=3 or id=4)
用$select->from('foo', '*');这样的方法怎么写?

------解决方案--------------------
再多写一个orwhere啊
------解决方案--------------------
也可以把where条件都写到一个$select->where();里面

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!