使用 Zend_Db_Expr
我有以下查询:
$select = $this->getDao()->select()
->from(
array(new Zend_Db_Expr('FROM_UNIXTIME(expiration)'))
);
getDao 函数是对我的数据访问对象类的引用,如下所示:
class Model_Db_AccountresetDao extends Zend_Db_Table_Abstract
{
protected $_name = 'accountreset';
protected $_primary = 'reset_id';
}
现在我收到以下错误:
“选择查询无法与另一个查询连接 表”
虽然我不想进行联接。我只想选择该字段作为 unixTimestamp
我怎样才能解决这个问题?
感谢所有帮助
。Tnx
I have the following query:
$select = $this->getDao()->select()
->from(
array(new Zend_Db_Expr('FROM_UNIXTIME(expiration)'))
);
The getDao function is a reference to my Data Access object class which looks like this:
class Model_Db_AccountresetDao extends Zend_Db_Table_Abstract
{
protected $_name = 'accountreset';
protected $_primary = 'reset_id';
}
Now i get this following error:
"Select query cannot join with another
table"
This while i don't want to do a join. I just want to select that field as a unixTimestamp
How can I solve this problem?
All help is appreciated.
Tnx
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您从 Zend_Db_Table_Abstract 中选择对象,则无法向他传递
->from()
。我认为你应该这样做或类似的事情。
If you are gettin select object from Zend_Db_Table_Abstract you can't pass him a
->from()
. I think you should do like thisor something like this.