user663878
user663878

Reputation: 2383

how to add another filter condition in zend framework query

This is my zend query

return $this->fetchRow($this->select()->where('name = ?', $geofence_name) );

and I want to add another filter in my query, because I want to check another condition.

please guide me.

Upvotes: 3

Views: 633

Answers (1)

S L
S L

Reputation: 14318

For and where

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

For or where

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

Upvotes: 10

Related Questions