Take
a look at solutions tailored specifically for JER
$band = 0;
while($category = mysql_fetch_assoc($cr)) {
$section_sql = "SELECT * FROM service WHERE category_id = ".$category['id']." and kw_intranet = 'y' ORDER BY name ASC";
$section_result = mysql_query($section_sql, $myconnection) or die(mysql_error());
$selection_rows = mysql_num_rows($section_result);
?>
if($selection_rows) { ?>