fr600,
the first query uses data the user submitted without any validation (e.g. making sure it does not contain special characters). It is likely to fail even with expected input, say if fr600 was submitted, because of missing quotes.
The latter uses a function that must be defined somewhere in your script (or in a script that this one includes). However if you have not written it and don't know what it does, you cannot be sure it is more secure.
BTW $username is no short form of $_POST['username'] anymore unless register globals are on.