I want to get employee name from $projSDE_1
that consists of emp ID
for each row in the for loop below from function func_GetEmpName($empID)
.For the code below it should display 10 rows with $projSDE_1's name
but the problem is the code outputs only the 1st row .Why the other 9 rows could not be display?Im already stuck with this problem for 1 week.If i remove the function it will display 10 rows
.All help appreciated.
<?php
for($i=0; $i<db_rowcount();$i++){
//loop through every result set
$projID=db_get($i,0);
$projNo=db_get($i,1);
$projDesc=db_get($i,2);
$projSDE_1=db_get($i,8);//1st Services Development Engineer
$projSDE_1_name = func_GetEmpName($projSDE_1);//get name from function
}//endfor
function func_GetEmpName($empID) {
$sqlEmp="select EmpID,LastName2_c from empbasic WHERE EmpID= '".$empID."'";
db_select($sqlEmp);
$rowcount=db_rowcount();
if(db_rowcount()>0){
for($f=0;$f<count($empID);$f++){
$empID=db_get($f,0);
$empName=db_get($f,1);
}
}
return $empName;
} // function
?>