2013년 4월 15일 월요일

codeigniter 에서 mysql NOW() 쓰는방법

각각 하나씩 set 을 하여 escape 시킨다

$data = array('name' => $name, 'count' => $count);
$this->db->set('updated_at', 'NOW()', false);
$this->db->insert('mytable');
view raw ci_sql_eval.php hosted with ❤ by GitHub
참고 : http://codeigniter-kr.org/user_guide_2.1.0/database/active_record.html
참고 : http://ellislab.com/forums/viewthread/73126/

댓글 없음:

댓글 쓰기