我正在努力建立一个绩效评估计划,每个员工都应该为他们的团队成员提交分数。因此,当员工登录其帐户时,他们的面板应显示:
我无法将每组问题的团队成员名称分开。
$MenilaiRekan1=mysqli_query($conn, "select NAMA from user where UNIT='$Unit2' AND CABANG='$Cabang2' and JABATAN='$Jabatan2' and NAMA<>'$Nama2'");
if (mysqli_num_rows($MenilaiRekan1)>0) {
while ($row=mysqli_fetch_array($MenilaiRekan1))
{
$NamaRekan=array($row['NAMA']);
}
}else{
echo "O results";
}
echo $NamaRekan[0];
答案 0 :(得分:0)
使用array_push()
为空数组添加值
$MenilaiRekan1=mysqli_query($conn, "select NAMA from user where UNIT='$Unit2' AND CABANG='$Cabang2' and JABATAN='$Jabatan2' and NAMA<>'$Nama2'");
if (mysqli_num_rows($MenilaiRekan1)>0) {
$NamaRekan = array();
while ($row=mysqli_fetch_array($MenilaiRekan1))
{
array_push($NamaRekan, row['NAMA']);
}
}else{
echo "O results";
}
echo $NamaRekan[0];