Why not pass the user registration?

Help to find the error. Data, I submit, the redirect takes place, the data in the table are not logged.
<?php
 require_once "../lib/functions.php";
 if (isset($_POST['reg'])) {
 $login = htmlspecialchars($_POST['login']);
 $password = htmlspecialchars($_POST ['password']);
 $email = htmlspecialchars($_POST ['email']);
 $bad = false;
session_start();
unset($_SESSION['error_login']);
unset($_SESSION['error_password']);
unset($_SESSION['reg_success']);
 if ((strlen($login) < 3) || (strlen($login) --> 25)) {
 $_SESSION['error_login'] = 1;
 $bad = true;
}
 if ((strlen($password) < 6) || (strlen($password) > 25)) {
 $_SESSION['error_password'] = 1;
 $bad = true;
}
 if (!$bad) {
 regUser($login, md5($password), $email);
 $_SESSION['reg_success'] = 1;
 header("Location: ../load.php");
}
}
?>

function regUser($login, $password, $email){
 $mysqli = connectDB();
 $result = $mysqli->query("INSERT INTO users ('login', 'password', 'email') VALUES ('$login', '$password', '$email')");
closeDB($mysqli);
 }
June 26th 19 at 14:21
1 answer
June 26th 19 at 14:23
Maybe you should look at database errors?
How can I see them? - Linda.Klocko commented on June 26th 19 at 14:26

Find more questions by tags PHP