2 回答
TA贡献1842条经验 获得超12个赞
尝试分配值之前
$query = $mysqli->prepare('UPDATE player SET lastLogin = ?,loginstreak = ? WHERE idplayer = ?');
$qdata = $now->format('Y-m-d H:i:s');
$idplayer = $_GET["idplayer"];
$query->bind_param("sis", $qdata, $loginStreak, $idplayer );
$query->execute();
TA贡献1813条经验 获得超2个赞
我认为您正在尝试传递DateTime对象作为引用?
[05-May-2019 21:19:05 Europe/Rome]在$qdata变量上
我认为您可以/应该重写
$query = $mysqli->prepare('UPDATE player SET lastLogin = ?,loginstreak = ? WHERE idplayer = ?');
$query->bind_param("sis", $qdata, $loginStreak, $_GET["idplayer"]);
$qdata = $now->format('Y-m-d H:i:s');
$query->execute();
使用NOW()更简单的MySQL函数。
$query = $mysqli->prepare('UPDATE player SET lastLogin = NOW(), loginstreak = ? WHERE idplayer = ?');
$idplayer = $_GET["idplayer"];
$query->bind_param("is", $loginStreak, $idplayer);
$query->execute();
- 2 回答
- 0 关注
- 186 浏览
添加回答
举报