先贴代码:
$tvlistid=$_REQUEST['tvlistid'];
//echo $tvlistid;可以输出
/*function insert_list_classaa ($tvlistid)
//{      global $conn;      $sql1 = "select * from channelclasstv where TVID=".$tvlistid;
$rs1 = $conn->execute($sql1);
        
$list1=explode("|",$rs1->fields['channelclass']);
       

$j=0;
while($j<count($list1)){
$sql1="select * from channelclass where classid=".$list1[$j];
if($j+1<count($list1)){
$sql1.=" Union All ";
}
$j++;
$sql=$sql.$sql1;
}
        $rs=$conn->execute($sql);
echo $sql;
        $i=0;
        while(!$rs->EOF)
        {
        $list[$i]['name']=$rs->fields['name'];
        $list[$i]['id']=$rs->fields['CLASSID'];
$list[$i]['descrip']=$rs->fields['descrip'];
$list[$i]['channel']=$rs->fields['channel'];
        $i++;
        $rs->movenext();//错误提示Call to a member function movenext() on a non-object
        }

解决方案 »

  1.   

    $rs=$conn->execute($sql);
    我怀疑你这句都没有执行成功,你var_dump一下
      

  2.   

    我把$sql输出来了:SELECT * from sconfigselect * from channelclass where classid=6 Union All select * from channelclass where classid=7,所以数据库连接是没有问题的!
      

  3.   

    我本来把这个写在function里面的,是可以执行的。但是$_REQUEST['tvlistid'];这个我是用Ajax取得的,到function里面就取不到了!
      

  4.   

    解决了,大侠们!谢谢各位!偶是把$sql设成全局变量了!