I want to make a condition that returns true if there are results. How do I do it?
$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; ?开发者_如何学Python>&colegio=<?php echo $row['Group']; ?>" class="<?php if ($group == $row['Group']) { echo "selected"; } ?>"><?php echo $row['Group']; ?></a> <?
}
}
Thanks
if (mysql_num_rows($result) > 0)
There should have something like:
if ($result.size > 0) {
// do this
}
精彩评论