apostrophe during Insert (Mysql)

后端 未结 3 1853
栀梦
栀梦 2020-12-07 04:22

I am getting data though a PHP text box and inserting it into a MySQL database with a normal insert command. The text box takes in a comment frm the user for a particular Ac

相关标签:
3条回答
  • 2020-12-07 04:59

    Use mysql_real_escape_string(), or better yet, use parameterised queries with PDO.

    0 讨论(0)
  • 2020-12-07 04:59

    Use MySQLi prepared statements.

    You can pass special characters easily without any extra work.

    Read MySQLi prepared statements.

    0 讨论(0)
  • 2020-12-07 05:14

    use the function mysql_real_escape_string()

    0 讨论(0)
提交回复
热议问题