Well, there is one major misunderstanding.
mysql_real_escape_string() does not clean anything. It has nothing to do with security at all.
This function is used just to escape delimiters and nothing more. It can help you to put string data into SQL query - that's all.
So, every string you're going to put into query (by putting it in quotes), you have to prepare it with this function. In all other cases it would be useless or even harmful.
Thus,
out of this misunderstanding, you're doing 2 major mistakes here:
- you're using this function not with data that's actually going to the query
- you can spoil your password by adding some symbols to it, so, it become unusable
Also, as a side note, please bear in mind that this function should be always used in conjunction with mysql_set_charset, or otherwise a "_real_"
part of this function become useless
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…