On checking your code I'm surprised it works at all when you don't quote the literals you are inserting - you will be generating code like:
INSERT INTO user (password, username) VALUES (abc1234fg00000, admin);
So it will give an error every time. Assuming this is just a typo....
The mysql extension limits your ability to perform injection attacks by only allowing one query per call. Also, there is limited scope for an injection attack on a INSERT statement. Add to that the fact that you change the representation to a neutral format before splicing into the insert statement means that it is not a potential avenue for such an attack. However, your code should fall over if someone POSTs a username containing a single quote (if it doesn't then you've got magic_quotes enabled enabled which is deprecated).
OTOH if you apply the same method to validating the account then you are wide open to injection attacks - consider
"SELECT 1
FROM users
WHERE username='" . $_POST['username'] . "'
AND password='" . sha1($_POST['username'] . "';";
If $_POST['username'] contains "admin' OR 1 " then your system is compromised.
You should always use mysql_real_escape_string() unless you've made the data safe using a different function (e.g. sha1, bas64_encode....but NOT addslashes)
C.