views:

643

answers:

1

I'm trying to use an array to set the where parameters for a Zend DB Table. I am trying to follow an example in the documentation:

$select = $table->select()->where(array('bug_status = ?' => 'NEW'));

I have a class that inherits Zend_Db_Table and am trying to select like the example:

$select = $this->select()->where(array('FirstName = ?' => 'Ryan'));

But I am getting an error that says "SQLSTATE[42S22]: Column not found: 1054 Unknown column 'Array' in 'where clause'". So it is not recognizing the array as an array and trying to use that as the column name.

Any ideas on whats going on here or how I can get Where to accept an array? Thanks!

+4  A: 

The correct syntax is where('FirstName = ?', 'Ryan'). I can't find the array version in the source code, so I'd say it's a "bug" in the documentation.

Lukáš Lalinský
http://framework.zend.com/issues/browse/ZF-8155
Lukáš Lalinský