slot_left가 가장 큰 행을 하나 선택해야합니다. 나는 시도했다슬롯이 가장 큰 행 선택
for ($i=1;$i<3;$i++) {
$sql5 = "SELECT * from user u where (
select max(slot_left) from company c,user u
where c.id=u.company_id and c.id='$name'
)";
$result5 = mysqli_query($link, $sql5) or die(mysqli_error($link));
while($row=mysqli_fetch_array($result5)) {
// echo the id which the slot_left is the biggest
echo $i['slot_left'];
}
}
아직도 할 수 없다. 도와주세요!
코드에 형식을 추가하십시오. – amosrivera
echo $ i [ 'slot_left']; ... 맞지 않을 수 있습니다. 아마도 $ row [ 'slot_left'] – Paul
내부 쿼리에 닫는 괄호가 없습니까? –