Call to undefined function now()

99封情书 提交于 2019-12-25 16:20:48

问题


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:


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

$this->load->helper('date');


来源:https://stackoverflow.com/questions/7992760/call-to-undefined-function-now

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!