Php 我的url转到?错误=没有,但没有插入到我的数据库中?
我试图建立一个登录系统,但我有一个奇怪的错误,一切正常,没有错误或任何东西,但没有插入到我的数据库 这是我的功能,将他们的数据插入到数据库中,有人看到这有什么问题吗Php 我的url转到?错误=没有,但没有插入到我的数据库中?,php,database,authentication,mysqli,Php,Database,Authentication,Mysqli,我试图建立一个登录系统,但我有一个奇怪的错误,一切正常,没有错误或任何东西,但没有插入到我的数据库 这是我的功能,将他们的数据插入到数据库中,有人看到这有什么问题吗 function createUser($conn, $username, $email, $password) { $sql = "INSERT INTO users (usersName, usersEmail, usersPwd) VALUES (?, ?, ?);"; $stmt = mysqli
function createUser($conn, $username, $email, $password) {
$sql = "INSERT INTO users (usersName, usersEmail, usersPwd) VALUES (?, ?, ?);";
$stmt = mysqli_stmt_init($conn);
if (!mysqli_stmt_prepare($stmt, $sql)) {
header("location: ../register.php?error=stmtfailed");
exit();
}
$hashedPassword = password_hash($pwd, PASSWORD_DEFAULT);
mysqli_stmt_bind_param($stmt, "ssss", $username, $email, $hashedPassword);
mysqli_stmt_execute($stmt);
mysqli_stmt_close($stmt);
header("location: ../register.php?error=none");
exit();
}
我已经检查了数据库连接,没有问题。我已经完了。
mysqli\u stmt\u bind\u param()
with“sss”
希望绑定4个参数。看在上帝的份上,不要关注youtube视频,这根本没有意义