Call to undefined function now()

2019-09-14 02:20发布

I'm using the Ion Auth library for the authentication system in a website I'm working on. It worked without any problem, but since yesterday I'm getting this error:

PHP Fatal error:  Call to undefined function now() in /home/carlo/public_html/website/application/models/ion_auth_model.php on line 996

The code in that line is this:

        $this->db->update($this->tables['users'], array('last_login' => now()), array('id' => $id));

I read that now() is a mysql function and in php you should use date(), but it seems strange to me that in the library there is a non existing function. Any idea what's happening here?

1条回答
甜甜的少女心
2楼-- · 2019-09-14 02:36

Use Codeigniters date hepler, it will allow you to use now().

$this->load->helper('date');
查看更多
登录 后发表回答