<?php
$conn = @new COM("ADODB.Connection") or die ("创建数据库连接失败!");
$rs->Open("select * from l_types where fid=0 order by id desc",$conn,1,1);
$rs_arr = array();
do{
$fid=$rs->Fields["id"]->Value;
echo $rs->Fields["typename"]->Value;
$rs2->Open("select * from l_types where fid =".$fid." order by id desc",$conn2,1,1);
do{
echo $rs2->Fields["typename"]->Value;
$rs2->MoveNext();
}while(!$rs2->EOF);
$rs2->close();
$rs->MoveNext();
$rs_arr[] = $fid;
 }while(!$rs->EOF);
$rs->close();
?>
我的目的是在同一个表(里面是类别,有父类也有子)中,要循环输出各父类和对应的子类!
这样写出现错误,请大吓们帮个忙!
如果有更好的方法请不吝赐教!
在此先谢过了!谢谢你!