I am using this code and i try to run it but it shows this error and try to fix it but i don't know how? Can anyone help me? :
Warning: mysqli_stmt_bind_param() expects parameter 1 to be mysqli_stmt, boolean given in /home/u330779411/public_html/Register.php on line 10
Warning: mysqli_stmt_execute() expects parameter 1 to be mysqli_stmt, boolean given in /home/u330779411/public_html/Register.php on line 11
Warning: mysqli_stmt_close() expects parameter 1 to be mysqli_stmt, boolean given in /home/u330779411/public_html/Register.php on line 13
Here is my code:
$name = $_POST['name'];
$matric_number = $_POST['matric_number'];
$username = $_POST['username'];
$password = $_POST['password'];
$statement = mysqli_prepare($con, "INSERT INTO Users (name, matric_number, username, password) VALUES (?, ?, ?, ?)");
mysqli_stmt_bind_param($statement, "siss", $name, $matric_number, $username, $password);
mysqli_stmt_execute($statement);
mysqli_stmt_close($statement);
mysqli_close($con);
Is it