I'm inserting data into my database. The data were inserted but i'm suppose to get OK as my result after data is inserted but i'm getting my else "Registration not complete".
Pls can anyone help?
here is my code
<?php
require 'functions.php';
require 'lib/password.php';
if(isset($_POST['username']) && isset($_POST['password'])){
$username = $_POST['username'];
$password = $_POST['password'];
if(!empty($username) && !empty($password)){
$hash = password_hash($password, PASSWORD_BCRYPT);
$query = "INSERT INTO users (id, username, password) VALUES ('','".$username."','".$hash."')";
if($conn->query($query)===TRUE){
echo 'Ok';
} else{
echo 'Registration not complete';
}
}
}
?>
<form action="register.php" method="POST">
Username: <input type="text" name="username"><br>
Password: <input type="password" name="password"><br>
<input type="submit" value="Register">
</form>