You want to use the show if recordset is empty:
<?php if ($totalRows_un > 0) { // Show if recordset not empty ?>
Username not recognised
<?php } // Show if recordset not empty ?>
but you also need to check whether the form was posted:
<?php if ($_SERVER["REQUEST_METHOD"] == "POST") { ?>
<?php if ($totalRows_un > 0) { // Show if recordset not empty ?>
Username not recognised
<?php } // Show if recordset is empty ?>
<?php } ?>