ah, probably because the last fetch array gives False. If I understand this right, you want it to print "good" if there is any row for this username, and no good only if there is no row.
If that is correct, then try this:
/////// Mechanism to determine if the user has and data saved to this table //////////////////////////
include_once "connect_to_mysql.php";
$sql = mysql_query("SELECT * FROM portfolio WHERE username='$username'");
if ( mysql_num_rows($sql) == 0)
print "return_msg=no_good";
else
print "return_msg=all_good";