Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all articles
Browse latest Browse all 14343

writing timestamp

$
0
0
This should not be the problem that it is. I am trying to update the last_login date in my table, employees.
PHP Code:
           $query=$this->db->get_where('employees', array('employee_email'=>$email_key));
 
           if ($query->result_id->num_rows 0)
 
           {
 
               $row=$query->row();
 
               $camp=$row->campaign;
 
               $this->db->set('last_login'NOW(), FALSE);
 
               $this->db->where('employee_email'$email_key);
 
               $this->db->update('employees');

 
           
last_login is defined as 'date'. For some reason it remains all zeroes although this code does run. Is there any type of return code or error message from db->update? I looked in mysql_error.log but it looks OK. Perhaps NOW is returning a string or some other format which can't be written directly into last_login?  When I browse my table I see 0000-00-00 in last_login. 

Viewing all articles
Browse latest Browse all 14343

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>