Before, it's not use to use it after...
mysql_real_escape_string() will escape a string before its insertion in a DB to prevent any form of code to be executed. For example, quotes are added a backslash before (" => \"), and so on.
As they always say, "Never trust user's input !"