求教,关于laravel的问题

WBOY
Release: 2016-06-06 20:07:38
Original
920 people have browsed it

在执行更新操作的时候

$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>
Copy after login

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

Related labels:
php
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template