$sql="SELECT sdcode,poscode,salary,fname,lname FROM emp e ,subdept s WHERE e.sdcode=s.sdcode"
$query .=$sql." GROUP BY e.sdcode,e.poscode,e.salary,e.fname,e.lname";
$rs = $adoconn->Execute($query ) or die($adoconn->ErrorMsg());
$totalRows = $rs->RecordCount();
if($totalRows>0){ //display data codetrade
$row=1 ;
while (!$rs->EOF) {
$a[$row]['sdcode'] = getSubdept($rs->Fields('sdcode'));
$a[$row]['fname'] = $rs->Fields('fname');
$a[$row]['lname'] =$rs->Fields('lname');
$a[$row]['poscode'] =$rs->Fields('poscode');
$rs->MoveNext();
}
}