开发者

Zend DB Table Where Clause

开发者 https://www.devze.com 2022-12-09 05:27 出处:网络
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:

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!


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消