为什么添加不成功? 写这么多,真的不好看呀,楼主,增加不成功时,看看你的提示错误,根据提示,去改问题,不过不成功的原因也就是以下几个:一是没有传值过去,二就是值传过去,但是变量没有写对,三就是数据类型错误,你最好在你的增加完成的那个页面先进行输出看看有没有值,问题就解决了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 现在我把adddelmok.php代码改成了下面的,可以每次只能添加进一条选中的记录.<?require ("config.php");$names = $addname;foreach($names as $key=>$name){ $sql="select programpath from distributeprogram where filename='$name'"; if(mysql_num_rows(mysql_query($sql))>=1) unset($names[$key]);}$str = "'".implode("','",$names)."'";if($str=="''") die('计划文件已存在或者没有新条目要添加!');$sql="select max(planid) maxid from distributeprogram";@$result=mysql_query($sql);while($rs=mysql_fetch_object($result)){ $startId = $rs->maxid+1;}if($startId==0) $startId = 1;for($j=0;$j<count($addname);$j++){ $tmp[] = "('$startId','".$addname[$j]."','$aimpath')";}require ("config.php");$query = "insert into distributeprogram(planid,filename,aimpath) values ";if(!is_array($tmp)) die('提交的信息中没有要进行添加');$query .= implode(',', $tmp);@$result=mysql_query($query);require ("config.php");$sql2="select max(planid) maxid from distributeplan";@$result2=mysql_query($sql2);while($rs=mysql_fetch_object($result2)){ $startId2 = $rs->maxid+1;}if($startId==0) $startId = 1;$query="insert into distributeplan(planid,sourceip,targetip,setplantime,execplantime,closeplantime,enabled,plankind,username) values('$startId2','$sourceip','$targetip','$setplantime','$execplantime','$closeplantime','$enabled','$plankind','$username')";@$result=mysql_query($query);if ($result) echo "<font color=red>恭喜您!成功添加记录!</font>";else echo "<meta http-equiv='refresh' content='2; url=addplan.php'><font color=red>添加失败!系统正在返回,请稍候...</font>";?> 求xss绕开htmlspecialchars过滤原理 为什么 我的 button 按钮点击没有反映那 ? 怎么判断两个标签匹配,如<td></td>匹配.... 到这里问个滚动条的问题,呵呵 请问如何保留HTML编码,使编辑器支持HTML功能?? 各位好,一个关于网站界面问题 简单问题出错 如何实现非法字符的检查 能否看到PHP的源代码? 求助:php与netscap Message Server 连接速度慢。 问个COOKIE的问题 小女子 求救!!!谁能帮我写个用socket上传图片的函数???
<?
require ("config.php");
$names = $addname;foreach($names as $key=>$name){
$sql="select programpath from distributeprogram where filename='$name'";
if(mysql_num_rows(mysql_query($sql))>=1)
unset($names[$key]);
}
$str = "'".implode("','",$names)."'";
if($str=="''") die('计划文件已存在或者没有新条目要添加!');$sql="select max(planid) maxid from distributeprogram";
@$result=mysql_query($sql);
while($rs=mysql_fetch_object($result)){
$startId = $rs->maxid+1;
}
if($startId==0) $startId = 1;for($j=0;$j<count($addname);$j++){
$tmp[] = "('$startId','".$addname[$j]."','$aimpath')";
}
require ("config.php");
$query = "insert into distributeprogram(planid,filename,aimpath) values ";
if(!is_array($tmp)) die('提交的信息中没有要进行添加');
$query .= implode(',', $tmp);
@$result=mysql_query($query);require ("config.php");
$sql2="select max(planid) maxid from distributeplan";
@$result2=mysql_query($sql2);while($rs=mysql_fetch_object($result2)){
$startId2 = $rs->maxid+1;
}
if($startId==0) $startId = 1;
$query="insert into distributeplan(planid,sourceip,targetip,setplantime,execplantime,closeplantime,enabled,plankind,username) values('$startId2','$sourceip','$targetip','$setplantime','$execplantime','$closeplantime','$enabled','$plankind','$username')";
@$result=mysql_query($query);
if ($result)
echo "<font color=red>恭喜您!成功添加记录!</font>";
else
echo "<meta http-equiv='refresh' content='2; url=addplan.php'><font color=red>添加失败!系统正在返回,请稍候...</font>";
?>