02.02.2014, 12:45
You should only escape strings when you input/pass as an argument a string to a query to avoid from being victim of SQL Injection. However, I recommend you to use mysql_format instead which does pretty much the same but it's more convinient than using mysql_real_escape_string all the time.