1
我無法弄清楚這一點。它應該是非常直接的,但是當我添加到期日期變量如下所示時,沒有記錄。不是會員或日期。當我刪除日期,它工作正常。我究竟做錯了什麼?在我的數據庫日期時間不會在數據庫中更新
到期日期設置爲時間戳
$uid = $_SESSION['userId'];
$uemail = $_SESSION['usersEmail'];
$uname = $_SESSION['usersName'];
$membership = 'Basic';
$expiration = date("Y-m-d H:i:s");
$stmt = $mysqli->prepare("UPDATE users
SET
membership = ?,
expiration_date = ?
WHERE usersEmail = '".$uemail."'");
$stmt->bind_param('s,s', $membership, $expiration);
$stmt->execute();
$stmt->close();
您確定在bindParam中's,s'之間需要逗號嗎? – 2014-11-21 18:31:38
那簡直太尷尬了,謝謝@AbhikChakraborty – looloobs 2014-11-21 18:52:01