Создаю регистрацию пользователя. Где-то произошла ошибка тк данные не записываются в базу. Подскажите, что я сделал не так?
Подключение к базе
<?php
$connection = mysqli_connect('localhost', 'root', '');
$select_db = mysqli_select_db($connection, 'db_name');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
<link rel="stylesheet" href="style.css">
</head>
<body>
<?php
require('connect.php');
if(isset($_POST['username']) && isset($_POST['password'])) {
$username = $_POST['username'];
$full_name = $_POST['full_name'];
$email = $_POST['email'];
$password = $_POST['password'];
var_dump($username, $full_name, $email, $password, $_POST['username'], require('connect.php'), $result);
$query = "INSERT_INTO users (username, full_name, password, email) VALUES ('$username', '$full_name', '$email', '$password')";
$result = mysqli_query($connection, $query);
if($result) {
$smsq = "Регистрация прошла успешно";
} else {
$fsmsg = "Ошибка";
}
}
?>
<div class="container">
<form class="form-signin" method="POST">
<h2>Форма регистрации</h2>
<?php if(isset($smsq)){ ?><div class="alert alert-succes" role="alert"><?php echo $smsg; ?></div> <?php } ?>
<?php if(isset($fsmsg)){ ?><div class="alert alert-danger" role="alert"><?php echo $fsmsg; ?></div> <?php } ?>
<input type="text" name="username" class="form-control" placeholder="Введите ваш логин" required>
<input type="text" name="full_name" class="form-control" placeholder="Введите ваше фио" required>
<input type="email" name="email" class="form-control" placeholder="Введите ваш email" required>
<input type="password" name="password" class="form-control" placeholder="Введите ваш пароль" required>
<button class="btn btn-lg btn-primary btn-block" type="submit">Регистрация</button>
</form>
</div>
</body>
</html>