开发者

Insert non literal values with codeigniters active record

开发者 https://www.devze.com 2023-01-23 02:41 出处:网络
Is it possible to i开发者_如何学Pythonnsert values like NOW() or users.username with active record. Codeigniter always wraps the values in quotes.Yes, it is - by using the set() method with the third

Is it possible to i开发者_如何学Pythonnsert values like NOW() or users.username with active record. Codeigniter always wraps the values in quotes.


Yes, it is - by using the set() method with the third parameter set to FALSE.

$this->db->set('date', 'NOW()', FALSE);
$this->db->insert('mytable');
0

精彩评论

暂无评论...
验证码 换一张
取 消