这段代码一直有异常。麻烦高手帮小弟我看上。已经研究了一上午了。多谢
程序员文章站
2022-06-04 18:02:35
...
这段代码一直有错误。麻烦高手帮我看下。已经研究了一下午了。谢谢
返回留言板
/*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
require("conn.php");
$user=$_POST['user'];
$title=$_POST['title'];
$content=$_POST['content'];
$sql_luck="insert into sny (id,user,title,content,lastDate)value('','$user','$title','$content',now())";
$sql="SELECT user FROM sny WHERE user='$user'";
$query =mysql_query($sql);
$rows=mysql_fetch_array($query);
if((!empty($_POST['sub']))and($rows['user']==$user)){
//echo $content;
echo "" ;exit;
mysql_free_result($query);exit;
}
else{
mysql_query($sql_luck);
echo"";
echo "插入成功";
}
?>
------解决方案--------------------
php 里面能用and吗还是用&&符号吧。?
------解决方案--------------------
你if判断仔细看看里边缕缕。好么?
返回留言板
/*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
require("conn.php");
$user=$_POST['user'];
$title=$_POST['title'];
$content=$_POST['content'];
$sql_luck="insert into sny (id,user,title,content,lastDate)value('','$user','$title','$content',now())";
$sql="SELECT user FROM sny WHERE user='$user'";
$query =mysql_query($sql);
$rows=mysql_fetch_array($query);
if((!empty($_POST['sub']))and($rows['user']==$user)){
//echo $content;
echo "" ;exit;
mysql_free_result($query);exit;
}
else{
mysql_query($sql_luck);
echo"";
echo "插入成功";
}
?>
------解决方案--------------------
php 里面能用and吗还是用&&符号吧。?
------解决方案--------------------
你if判断仔细看看里边缕缕。好么?
相关文章
相关视频