我使用的网址:../ accessogiornaliero.php?idplayer = 45ccf2a79ec84c
accessogiornaliero.php:
$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();
错误:
[05-May-2019 21:19:05 Europe/Rome] PHP Fatal error: Uncaught Error: Cannot pass parameter 3 by reference in .../accessogiornaliero.php:62
Stack trace:
#0 {main}
thrown in .../accessogiornaliero.php on line 62
我哪里错了?
最佳答案
尝试分配值之前
$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();