hi guys please l need some help. lm setting up a user registration sign up form. but l was NOT ABLE TO INSERT THE USER INFO IN TO THE DATABASE. And the code did not display any error message, meaning that everything is fine. But when l tried to sign up it gives the form's error message "Failed to Register User".
this is the code: (and check at the bottom the connect.php code)
<?php
require_once('connect.php');
//print_r($_POST);
if(isset($_POST) & !empty($_POST)) {
    $username = $_POST['username'];
    $email = $_POST['email'];
    $password = $_POST['password'];
    // storing the sign up info in to the database
    $sql = "INSERT INTO usermanagement (username, email, password) VALUES ('$username', '$email', '$password')";
    //executing the query
    $result = mysqli_query($connection, $sql);
    if($result){
        echo "User Registered Successfully";
    }
    else{
        echo "Failed to Register User";
    }
}
?> 
    <div id="form-signup">
                    <form id="signup-form" name="sign-up" action="sign.php" method="POST">
                            <h1>Create your profile</h1>
                            <p>
                                <input type="text" name="username" id="username" class="signup-input" required="required" placeholder="Full name*" >
                            </p>
                            
                            <p>
                                <input type="email" name="email" class="signup-input" required="required" placeholder="Email*" >
                            </p>
                            <p>
                                <input type="password" name="password" class="signup-input" required="required" placeholder="Mot de passe*">
                            </p>
                            <!-- <p>
                                <input type="password" name="confirmpassword" class="signup-input" required="required" placeholder="Confirmez mot de passe*">
                            </p> -->
                            <p class="agree"> By signing up, you agree to Tout-Passe's <br><a href="condition.php"> Terms of use</a><br> and <a href="politic.php">Privacy Policy</a>.
                            </p>
                            <p>
                                <input type="submit" class="signup-btn" name="btn-signup" value="Create Account">
                            </p>
                            <p class="already">Already on Tout-Passe? <a href="log.php"> Log in</a></p>
                        </div><!--END OF PHASE-1-->
                    </form> <!--END OF SIGN-UP-->
                </div><!--END FO ALLFORM-->
CONNECT CODE
<?php 
$connection = mysqli_connect('localhost', 'root', '');
if(!$connection){
    die("Database Connection Failed" . mysqli_error($connection));
}
$select_db = mysqli_select_db($connection, 'listing');//listing = database
if(!$select_db){
    die("Failed to select database" . mysqli_error($connection));
}
?>
 
     
    