0
我想做出一個條件,如果有結果返回true。我該怎麼做?查看MySQL查詢是否有結果的條件?
$result = mysql_query("SELECT * FROM `Groups` WHERE `City` = '$city2' LIMIT 12 OFFSET 6");
if (the condition) {
while($row = mysql_fetch_array($result)) { ?>
<a href="/?ciudad=<?php echo $city; ?>&colegio=<?php echo $row['Group']; ?>" class="<?php if ($group == $row['Group']) { echo "selected"; } ?>"><?php echo $row['Group']; ?></a> <?
}
}
感謝