Привет народ. Пожалуйста подскажите в чем ошибка.
$dbc = mysqli_connect('localhost', 'root', '', 'registr');
if(isset($_POST['send'])){
$username = htmlspecialchars(trim($_POST[username]));
$password = htmlspecialchars($_POST[password]);
$password_2 = htmlspecialchars($_POST[password_2]);
if(!empty($username) && !empty($password) && !empty($password_2) && $password == $password_2){
$query = "SELECT * FROM `registr` WHERE username = '$username'";
$data = mysqli_query($dbc, $query);
if(mysqli_num_rows(($data) == 0){
$query = "INSERT INTO `registr` (username, password) VALUES ('$username', '$password')";
mysqli_query($dbc, $query);
echo "All good!";
mysqli_close($dbc);
exit();
}
else{
echo 'Name was registered';
}
}
}
Parse error: syntax error, unexpected '{' in W:\domains\Test\index.php on line 11