如何在db->insert()中使用mysql函数
$data = array(
'title' => $this->input->post('title',true),
'body' => $this->input->post('title',true),
'time' => ' NOW() ',
'cid' => $this->input->post('cid',true),
);
$this->article->add($data);
NOW()被当做字符串加入了,如果这里不用PHP的时间函数生成时间,CI有提供什么方法让这里能否执行MYSQL函数吗? $this->db->set('time','NOW()',false);
认真看手册 嗯。感谢指点。。以后一定认真看手册。。
页:
[1]