PHP PDO bindParam with html content

后端 未结 1 1752
天命终不由人
天命终不由人 2020-12-18 16:29

I try to save html content to the database, with \' or \" it auto give a slash which is great so I don\'t have to do mysql_escape_string. However when I load up the string i

相关标签:
1条回答
  • 2020-12-18 16:52

    use

    $pdo->bindValue(':html', $html, PDO::PARAM_STR);
    

    instead of

    $pdo->bindParam(:html, $html);
    
    0 讨论(0)
提交回复
热议问题