Answer the question
In order to leave comments, you need to log in
Why is the user not created in the database when the request is successfully executed?
There is a piece of code (cut out of context):
$member_group = 'user';
$password = hash('sha256', $password);
$sql = 'INSERT INTO users (login,email,password,invite,member_group) VALUES(?,?,?,?,?)';
if($stmts = $this->db->prepare($sql)) {
$stmts->bind_param("sssss", $login, $email, $password,$invite,$member_group);
$stmts->execute();
} else {
$this->error = $this->db->errno . ' ' . $this->db->error;
}
$user_id = $stmts->insert_id; // Получаем ID созданного пользователя
$stmts->close();
Answer the question
In order to leave comments, you need to log in
binding curve parameters? Is PDO::ERRMODE_SILENT worth it? $stmts->execute() returns false?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question