How is my injection protection?
Give me parameterized SQL or give me death!
Seriously. Use prepared statements! Don't use mysqli_query as that makes your code vulnerable to SQL Injection. By using prepared statements, you won't need the mysqli_real_escape_string calls anymore.

This code looks nasty:
$result1 = mysqli_query($con, $sql);
if (!$result1 || mysqli_query($con, $sql)) {
    die('Invalid query: ' . mysqli_error());
}

First you perform the query. If the query fails (i.e. it returns a false-ish value), you die, but if the query works then you call the query again. And if the second query is successful, then you call die.
THAT MAKES NO SENSE!

This code can't possibly be working:
$dblink = &quot;SELECT * FROM users WHERE (username= '&quot; . $username . &quot;')&quot;;
$dblink-&gt;bind_param('username', $username);

And again, don't concatenate SQL queries! Use prepared statements!

Use better variable names!
What is $result1 and what is $result2? Describe what the result is for in the variable name.

You have a whole bunch of empty blocks, such as this:
if ($emailLength &gt;= 3 &amp;&amp; $emailLength &lt;= 42) {
    
} else {
    
$errorMessage = $errorMessage . &quot;Email must be between 3 and 42 characters&quot; . &quot;&lt;BR&gt;&quot;;
    
}

Also work on your indentation. Fixing the indentation, the if-logic and the string concatenation, and I suggest that you write your HTML tags with lowercase, this can be:
if ($emailLength &lt; 3 || $emailLength &gt; 42) {
    $errorMessage .= &quot;Email must be between 3 and 42 characters&lt;br&gt;&quot;;
}