SELECT s.ids, s.nazev, o.ido, o.nahl_poloha, o.nahl_width, o.nahl_height FROM rs_imggal_sekce AS s LEFT JOIN rs_imggal_obr AS o ON s.ids = o.sekce GROUP BY s.ids ORDER BY s.ids;
<?php if (isset($radek["nahl_poloha"] && !empty($radek["nahl_poloha"])) { // fotogaleria nie je prazdna } else { // fotogaleria je prazdna } ?>