Warning: mysql_real_escape_string(): Access denied for user ''@'localhost' (using password: NO)

前端 未结 5 702
迷失自我
迷失自我 2021-01-18 21:18

When is use the following code without mysql_real_escape_string, works fine. I simply trying to grab a text string that may have apost. from an input form and format it to p

5条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-18 22:14

    No, you shouldn't mix mysql and mysqli.

    Use here instead of mysql_real_escape_string($var):

    $con->real_escape_string($var);
    

提交回复
热议问题