一旦滿足要求,我的代碼回顯Hey或Hello兩次。這應(yīng)該檢查一個(gè)人是否有上傳的東西,這取決于他們是否有或沒(méi)有消息顯示。$sql = "SELECT * FROM users";$result = mysqli_query($conn, $sql);if (mysqli_num_rows($result) > 0) { while ($row = mysqli_fetch_assoc($result)) { $sqlImg = "SELECT * FROM users WHERE idUsers='$current'"; $resultImg = mysqli_query($conn, $sqlImg); while ($rowImg = mysqli_fetch_assoc($resultImg)) { if ($rowImg['profile_img'] == 0) { echo "hey"; } else { echo "Hello"; } } }}我希望輸出回顯一次,但實(shí)際輸出回顯兩次。
如何讓我的代碼只回顯一次而不是兩次?
慕工程0101907
2021-11-05 16:22:18