mysql_real_escape_string(
Üsteki kod yerine alttaki kodu kullanıp deneyin.

mysqli_real_escape_string