ProAnswers.org

How do you escape database queries with PHP?

How do you escape database queries with PHP?

Use mysql_real_escape_string(), after you've connected to your database. If that function doesn't work, use mysql_escape_string() or addslashes(). Never leave your database input vulnerable to attack.