mysqli_real_escape_string not working properly

前端 未结 2 1163
滥情空心
滥情空心 2021-01-25 05:48

I\'ve searched and yet nothing I find seems to work.

My problem is that when using special characters as \' the input query breaks. Now, I tried using the mysqli_real_es

相关标签:
2条回答
  • 2021-01-25 06:22

    You forgot your resource parameter:

    $title = mysqli_real_escape_string($connect, $_POST['title']);
    

    PHP Manual

    0 讨论(0)
  • 2021-01-25 06:26

    Or

    $title = $connect->real_escape_string($_POST['title']);
    
    0 讨论(0)
提交回复
热议问题