views:

204

answers:

1

I need to quote a string a string in PHP using Kohana 3's Database library. In 2.3, all I had to do is $this->db->escape().

How can I do this in 3? I seem to remember seeing something like quote() when I was viewing the source, but for the life of me can I find it again.

+4  A: 

The Database class has a escape() method, look here.

dusan
So I guess usage would be `DB::escape()` ?
alex
You can execute `Database::instance()->escape($string)`.
dusan
Many thanks Dusan
alex