时间:2021-07-01 10:21:17 帮助过:5人阅读
用的什么数据库?
用的数据库是 mysql
update apple set `comment`='xxx' where name='aa'
set 后面接双引号还是单引号啊?
(以下为完整代码,我不知道错在哪?好像是语法上的引号问题)
session_start();
if(isset($_SESSION['nowuser'])){
$username= $_SESSION['nowuser'];
$reason=$_POST['reason'];
//检查表单
if(strlen($reason) >0){
$sql = "select * from module1 where username='".$username."' ";
update reason set `comment`='$reason' where name='$username';
$sql = "INSERT INTO module1(reason)VALUES('reason')";
if(mysql_query($sql,$conn))
exit('提交成功!);
else
echo"提交失败!";
}else{
exit('请填写完空白处再进行提交!返回');}
}else{
exit('未登入!返回');
?>