往数据里添加不成功的问题. 你通过直接在数据库中执行你的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 Snoopy采集类采集ebay数据的问题,谢谢! 请问,进销存系统的数据如何自动更新的电子商务的网站上?请给一个思路也有分! 关于函数内global的作用域的疑问 可编辑的表格? 在线等!!!!!!!!!!1 使用PHP调用Java类成功了,但是页面最底部总有一行报错。请问是什么原因? 请问:用php如何实现打开一个打开文件对话框?代码怎么写?谢谢!! 急!!!update 的奇怪问题 cookie的设置问题???求解中 请问大家用什么开发环境? 在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>";
?>