PHPパラメータの受け渡し問題
getStaffListByID関数のループ内でgetStaffListByLID関数を呼び出したいのですが、getStaffListByLIDにlidの値が渡されないようです。
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> 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"); } }