Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/250.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 我的url转到?错误=没有,但没有插入到我的数据库中?_Php_Database_Authentication_Mysqli - Fatal编程技术网

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视频,这根本没有意义