alex
alex

Reputation: 490263

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

Upvotes: 1

Views: 1240

Answers (3)

shadowhand
shadowhand

Reputation: 3201

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

Upvotes: 2

Nodren
Nodren

Reputation: 558

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

Upvotes: 2

Chris Gutierrez
Chris Gutierrez

Reputation: 4755

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.

Upvotes: 1

Related Questions