0
How do I return my query only records that are filled? My table has some blank records that are returned by the association.
<?php
$consulta = $pdo->query("SELECT * FROM ws_so_wind, ws_soft_gallery WHERE id_soft = id_img AND id_soft = $id_soft ");
foreach ($consulta as $foto) {
?>
<a href="<?= BASEIMG ?><?= $foto['url_gallery']; ?> " data-lightbox="set" data-title="">
<img itemprop="screenshot" class="screenshot" src="<?= BASEIMG ?><?= $foto['url_gallery']; ?> "></a>
<?php } ?>
I suggest you read on
INNER|LEFT|RIGHT JOIN
, they will solve your problem =)– user3603