Consider why you would get this result logically --
Your check states that if $rows is not an array, or the length of the array is NOT 1, then it's a failure.
In PHP, var_dump() is your friend (your best friend. Take it out to dinner and treat it nice sometimes. He works so hard for you!). It will help you debug almost anything. In this case, on line 25 I would put
var_dump($rows);
exit();
and see what the output is.
You will likely find that rows is not an array, but instead may be some sort of string or object - alternatively, you may have multiple results or no results, and you will have to check your query to make sure it is doing exactly what you want it to be doing. Perhaps you will need more constraints in your where clause to limit your result set, though I find it strange that you would allow multiple admins with the same username (however, in testing you may have accidentally inserted the same user multiple times).
Hope that helps,
Ryan