PHP/MySQL - SQL syntax error?

后端 未结 3 1826
予麋鹿
予麋鹿 2021-01-27 16:11

Now when I submit the character \' I get the following error listed below other then that everything is okay when I submit words. I am using htmlentities()

3条回答
  •  粉色の甜心
    2021-01-27 16:46

    put your SQL query into a variable e.g.

    $query = "SELECT * FROM table WHERE field= ".mysql_real_escape_string($var)."";
    
    echo $query;
    
    $result = mysql_query($query);
    

    you can then inspect what is actually sent to mysql as the query

提交回复
热议问题