<?php
if($_POST['submit'] == "Submit")
{
$t = "UPDATE golf_details SET description = REPLACE(description , '"', '')";
mysql_query($t);
}
echo "hwllo";
?>
如何在提交点击时从表单中替换“空白或者可以如何删除”。
答案 0 :(得分:5)
PHP str_replace()
$desc=str_replace('"','',$desc);
echo $desc;
然后在你的陈述中
UPDATE XX SET description=$desc
答案 1 :(得分:2)
只需修改SQL以转义双引号。
$t = "UPDATE golf_details SET description = REPLACE(description , '\"', '')";
mysql_query($t);
你在SET
使用双引号,当然,它打破了PHP字符串。