[zend][db] fetchAll with multiple variables
问题 I'm trying to use fetchAll on a query that has 2 variables. I can't figure out the syntax. I can manage with only 1 variable: $sql = "SELECT * FROM mytable WHERE field1 = ?"; $this->_db->fetchAll($sql,$value1); # that works However I'm having some issues when query has multiple variables $sql = "SELECT * FROM mytable WHERE field1 = ? AND field2 = ?"; $this->_db->fetchAll($sql,$value1,$value2); # doesn't work $this->_db->fetchAll($sql,array("field1"=>$value1,"field2"=>$value2)); # doesn't work