我无法弄清楚这一点。它应该非常简单,但是当我添加到期日期变量时,如下所示,没有记录任何内容。不是会员或日期。当我删除它的日期工作正常。我做错了什么?
我的数据库中的expiration_date设置为timestamp
$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();
答案 0 :(得分:0)
你的bind_param必须是:
$stmt->bind_param("ss",$membership, $expiration);
http://php.net/manual/en/mysqli-stmt.bind-param.php
Abhik Chakraborty在评论部分指出。