Kohana 3.1 ORM DB Query

150 views Asked by At

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

There are 1 answers

0
Aksebkit On BEST ANSWER

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

If anyone wants a code please write.