views:

542

answers:

3

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

+1  A: 

I'm pretty positive Kohana does not do this. When looking at the Database class, all bound parameters are handled in a method called compile_binds... Looks like it only supports the ? syntax.

Chris Gutierrez
Thanks for your answer. I wish they would support it.
alex
yeah... it definitely makes things easier to read.
Chris Gutierrez
+2  A: 

that functionality is available in the new 2.4/3.0 versions of Kohana, the current 2.3 release does not support it.

Nodren
+1  A: 

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

shadowhand