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');
精彩评论