MySQL Query not inserted when PHP variable contains single quotes

后端 未结 7 732
情书的邮戳
情书的邮戳 2021-01-17 05:49

This query not inserted when variable $subject has single quotes . Is there any possible solution available ?

mysql_query(\"INSERT INTO  table  (to_email_id,         


        
7条回答
  •  被撕碎了的回忆
    2021-01-17 06:31

    You need to use mysql_real_escape_string() on your values $to and $subject

    Also if you weren't doing this before you are open to sql injection

提交回复
热议问题