Well, I want to know some tips about PHP and MySQL.
When I get data from user then I use the following validation:
mysql_real_escape_string()
or
htmlentities()
or
trim()
Is it a secure way to get data from the user?
And what is the best way to retrieve data from Mysql database? I used nl2br(), but if i submit I'm here Then it shows I\'m here. It should be showing I'm here. I don't know what the correct method is.
 
    