开发者

Insert non literal values with codeigniters active record

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜