"; #echo "token: " . $token; $actualdate = date('Y/m/d H:i:s'); $sql = "select stars, stars_b2, stars_c1, stars_c2 from schedule where facilityno in (select facilityno from schedule where id = '$id_schedule') and actualdate is not null order by id desc limit 1"; $res = mysqli_query($link, $sql); while ($row = mysqli_fetch_assoc($res)) { $stars = ($row["stars_c1"] <> "") ? $row["stars_c1"] : (($row["stars"] <> "") ? $row["stars"] : ""); $stars2 = ($row["stars_c2"] <> "") ? $row["stars_c2"] : (($row["stars_b2"] <> "") ? $row["stars_b2"] : ""); } mysqli_free_result($res); $stars = ($stars) ? $stars : 5; $stars2 = ($stars2) ? $stars2 : 5; ?>