vikmalhotra
vikmalhotra

Reputation: 10071

CodeIgniter Active Record: how to use "set" method with mysql functions

I have my query something like this

INSERT INTO tbl VALUES(UNHEX('some_value'));

How can I pull this query off using codeigniter active record, specifically the '$this->db->set' function

this->db->set('password', $value); // How do I insert the mysql function here
$this->db->insert('tbl');

Upvotes: 2

Views: 6474

Answers (1)

Repox
Repox

Reputation: 15476

Take a look at the documentation - it states that if you need some value unescaped, you should set the third parameter in set() to false. Like this:

$this->db->set("password", "UNHEX('".$value."')", FALSE);

Upvotes: 4

Related Questions