How to fix "Parse error: syntax error, unexpected '}" : <p>I'm working with if statements, and I cannot seem to find where I'm going wrong, I'm fairly new to PHP so If someone can maybe guide me in the right direction it would be awesome, thanks.</p>

<p>I've tried to rewrite the whole code, and experimented by adding more "}" on the end of the code, which did not seem to work at all.</p>

<pre class="lang-php prettyprint-override"><code>&lt;?php
$username = "";
$email = "";
$errors = array();

    //Connect to the database
    $db = mysqli_connect('localhost', 'root', '', 'registration');

    //If the register button is clicked
    if (isset($_POST['register'])){
        $username = mysql_real_escape_string($_POST['username']);
        $email = mysql_real_escape_string($_POST['email']);
        $password_1 = mysql_real_escape_string($_POST['password_1']);
        $password_2 = mysql_real_escape_string($_POST['password_2']);
        //Ensure that the form fields are filled correctly.
        if (empty($username)){
            array_push($errors, "A username is required.")}
        if (empty($email)){
            array_push($errors, "An email is required.")}
        if (empty($password_1 != $password_2)){
            array_push($errors, "Passwords do not match.")}
        }

</code></pre>
