You don't really need to use mysql_real_escape_string for passwords that are hashed in md5, because md5 hases will never have ' or "
The manual entry for mysql_real_escape_string is pretty self explanatory, If you want some more advanced functions check out the user comments too.