Search code examples
phpmysqlkohanadatabaseparameterized

Binding params with Kohana's Database library


I know I can bind params in Kohana like this

$this->db->query('SELECT * FROM products WHERE id = ?', array(14));

But is there a way to do it with identifiers (or whatever they are called?)

As in

$this->db->query('SELECT * FROM products WHERE id = :id', array(':id' => 14));

Thanks


Solution

  • Version 2.x has no support for it, but 3.x supports it. See this forum post.