Home  >  Article  >  Backend Development  >  求教,关于laravel的问题

求教,关于laravel的问题

WBOY
WBOYOriginal
2016-06-06 20:07:38860browse

在执行更新操作的时候

$resetPass = Users::where('username','=',$_POST['userName'])->update(array('password' => md5($_POST['pwd1']),'resetTime' => time()));

以上语句就成功

$resetPass = Users::where('username','=',$_POST['userName'])->update(array('password' => md5($_POST['pwd1'])));

以上语句就失败

求教

回复内容:

在执行更新操作的时候

$resetPass = Users::where('username','=',$_POST['userName'])->update(array('password' => md5($_POST['pwd1']),'resetTime' => time()));

以上语句就成功

$resetPass = Users::where('username','=',$_POST['userName'])->update(array('password' => md5($_POST['pwd1'])));

以上语句就失败

求教

差异不就在 resetTime 字段,你的 user 表有没有这个字段呢

在Users的modal里面试着添加这一行

<code>public $timestamps = false;</code>

这个可以让laravel关闭自动维护时间字段

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn