Welcome Guest, Not a member yet? Register   Sign In
Using MySQL Function on CI Database function??
#1

[eluser]Adods[/eluser]
Can I use mysql function in CI database function like NOW() or CURDATE()??

How do I use them??

Code:
$this->db->where('id',$id)
$this->db->update('sometable',array('field'=>'NOW()'));

Will this work???
#2

[eluser]happs74[/eluser]
I use date("Y-m-d H:iConfused") to insert the current datetime into the db.
#3

[eluser]xwero[/eluser]
The function is escaped if you do it like that.
Code:
$this->db->set('field','NOW()',FALSE);
$this->db->where('id',$id)
$this->db->update('sometable');
Will work




Theme © iAndrew 2016 - Forum software by © MyBB