I want to check if the username exists in my database. I wrote the following code to check if the username exists but it isn't doing anything. I also don't know how to code in java that's why I put it in my php file. Can someone help me?
$statement = mysqli_prepare($con, "INSERT INTO users (username, password) VALUES (?, ?)");
if($username > 0){
echo "This username is in use.";
}
mysqli_stmt_bind_param($statement, "ss", $username, $password);
mysqli_stmt_execute($statement);
$response = array();
$response["success"] = true;
print_r(json_encode($response));