如何在Zend Framework查询中添加另一个筛选条件

3
这是我的Zend查询。
return $this->fetchRow($this->select()->where('name = ?', $geofence_name) );

我想在我的查询中添加另一个过滤器,因为我想检查另一个条件。请指导我。
1个回答

10

对于 and where

$select = $db->select()
    ->from('products',
        array('product_id', 'product_name', 'price'))
    ->where('price > ?', $minimumPrice)
    ->where('price < ?', $maximumPrice);

对于或者(where)

$select = $db->select()
     ->from('products',
            array('product_id', 'product_name', 'price'))
     ->where('price < ?', $minimumPrice)
     ->orWhere('price > ?', $maximumPrice);

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接