donglan9651
2016-12-23 13:03
浏览 25
已采纳

Kohana 3.1 ORM数据库查询

I have app in Kohana 3.1 and it was woring fine on PHP 5.4

But after migration this DB query is not working:

DB::select(array('MAX("art_nr")', 'art_nr'))->from('wi_artykuly')->execute()->get('art_nr');

If any function is depricated or something?

EDIT

Here's full function:

 public function create(Validation $validation = NULL)
{
    if(! isset($this->art_nr))
    {
        $intMax = DB::select(array('MAX("art_nr")', 'art_nr'))->from('wi_artykuly')->execute()->get('art_nr');
        $this->art_nr = $intMax+1;
    }
    return parent::create($validation);
}
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • duannian7116 2017-01-09 08:55
    已采纳

    I've changed DB:query to PDO prepare and fetch.

    If anyone wants a code please write.

    已采纳该答案
    打赏 评论

相关推荐 更多相似问题