日期:2014-05-17 浏览次数:20426 次
function getStaffListByID($con){ global $idn,$id,$pic,$name; $sel = "select id,pic,name from student;"; $ret = pg_Exec($con,$sel); $idn = pg_NumRows($ret); for ( $i=0; $i<$idn; $i++ ) { $id[$i] = pg_Result($ret, $i, "id"); echo '$id[$i]'.$id[$i]; $lid = $id[$i]; getStaffListByLID($con,$lid); $pic{$id[$i]} = pg_Result($ret, $i, "pic"); $name{$id[$i]} = pg_Result($ret, $i, "name"); } } function getStaffListByLID($con,$lid){ global $tidn,$tid,$tpic,$tname; echo 'ereree'.$lid; $sel = "select tid,tpic,tname from teacher;"; $ret = pg_Exec($con,$sel); $tidn = pg_NumRows($ret); for ( $i=0; $i<$tidn; $i++ ) { $lid[$i] = pg_Result($ret, $i, "tid"); $lpic{$id[$i]} = pg_Result($ret, $i, "tpic"); $lname{$id[$i]} = pg_Result($ret, $i, "tname"); } }