PHP Filter Input Escape Output
<p>Will it be better if i add to mysql_real_escape_string also addslashes like that:</p>

<pre><code>$username = mysql_real_escape_string(trim(addslashes($_POST['username'])));
</code></pre>

<p>And is there any need in this in password var:</p>

<pre><code>$password = md5(mysql_real_escape_string(trim($_POST['password'])));
</code></pre>

<p>Also i read some topics about safe retrieving data from db...
it says that it would be better to retrieve data like that:</p>

<pre><code>htmlentities(stripslashes($v))
</code></pre>

<p>Is it really necessary for safety?</p>
