往数据里添加不成功的问题. 你通过直接在数据库中执行你的sql查询语句,看看又没有问题,再打开数据库看看有没有数据,如果有说明你在查找时的变量名错,或者其它的错误 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 $str = "'".implode("','",$names)."'";if($str=="''") die('计划文件已存在或者没有新条目要添加!');require ("config.php");$sql="select max(planid) maxid from distributeprogram";@$result=mysql_query($sql);($rs=mysql_fetch_object($result)){ $startId = $rs->planid+1;}if($startId==0) $startId = 1;$sql="select * from distributeprogram where programpath in ($str)";@$result=mysql_query($sql);while($rs=mysql_fetch_object($result)){ $tmp[] = "('$startId','".$rs->title."')"; $statrId++;}require ("config.php");$query = "insert into distributeprogram (planid,programpath) values ";if(!is_array($tmp)) die('数据库查找失败'); <?require ("config.php");$names = $addname;foreach($names as $key=>$name){ $sql="select programpath from distributeprogram where programpath='$name'"; if(mysql_num_rows(mysql_query($sql))>=1) unset($names[$key]);}$str = "'".implode("','",$names)."'";if($str=="''") die('计划文件已存在或者没有新条目要添加!');require ("config.php");$sql="select max(planid) maxid from distributeprogram";@$result=mysql_query($sql);while($rs=mysql_fetch_object($result)){ $startId = $rs->planid+1;}if($startId==0) $startId = 1;$sql="select * from distributeprogram where programpath in ($str)";@$result=mysql_query($sql);while($rs=mysql_fetch_object($result)){ $tmp[] = "('$startId','".$rs->title."')"; $statrId++;}require ("config.php");$query = "insert into distributeprogram (planid,programpath) values ";if(!is_array($tmp)) die('数据库查找失败');$query .= implode(',', $tmp);@$result=mysql_query($query);if ($result) echo "<font color=red>恭喜您!成功添加记录!</font>";else echo "<meta http-equiv='refresh' content='2; url=add.php'><font color=red>添加失败!系统正在返回,请稍候...</font>";?> php在交叉编译到MIPS平台,无法获取系统时间 mysql上的一个数据类型的小问题,求教 初学,有没有什么好一点的书籍推荐?谢谢!!^_^ 未进行数据库操作,可却更新数据库了 asp连接mysql连接如何写啊 PHP类调用 为什么php的设计模式不如asp.net却又那么多人在用它? PHP PDO 调用存储过程 返回多个集合 和 输出参数 如何获取? 正则疑问:匹配网页图片 请问一个Cookies的问题,很急,望帮忙! 请问大家用什么开发环境? 在redhat9.0下安装php几个问题?
if($str=="''") die('计划文件已存在或者没有新条目要添加!');
require ("config.php");
$sql="select max(planid) maxid from distributeprogram";
@$result=mysql_query($sql);
($rs=mysql_fetch_object($result)){
$startId = $rs->planid+1;
}
if($startId==0) $startId = 1;
$sql="select * from distributeprogram where programpath in ($str)";
@$result=mysql_query($sql);
while($rs=mysql_fetch_object($result)){
$tmp[] = "('$startId','".$rs->title."')";
$statrId++;
}
require ("config.php");
$query = "insert into distributeprogram (planid,programpath) values ";
if(!is_array($tmp)) die('数据库查找失败');
require ("config.php");
$names = $addname;foreach($names as $key=>$name){
$sql="select programpath from distributeprogram where programpath='$name'";
if(mysql_num_rows(mysql_query($sql))>=1)
unset($names[$key]);
}
$str = "'".implode("','",$names)."'";
if($str=="''") die('计划文件已存在或者没有新条目要添加!');
require ("config.php");
$sql="select max(planid) maxid from distributeprogram";
@$result=mysql_query($sql);
while($rs=mysql_fetch_object($result)){
$startId = $rs->planid+1;
}
if($startId==0) $startId = 1;
$sql="select * from distributeprogram where programpath in ($str)";
@$result=mysql_query($sql);
while($rs=mysql_fetch_object($result)){
$tmp[] = "('$startId','".$rs->title."')";
$statrId++;
}
require ("config.php");
$query = "insert into distributeprogram (planid,programpath) values ";
if(!is_array($tmp)) die('数据库查找失败');
$query .= implode(',', $tmp);
@$result=mysql_query($query);
if ($result)
echo "<font color=red>恭喜您!成功添加记录!</font>";
else
echo "<meta http-equiv='refresh' content='2; url=add.php'><font color=red>添加失败!系统正在返回,请稍候...</font>";
?>