Question

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!

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top