php - Not showing a picture where table field is empty -


i have mtsql database 25 images can stored, in table fields called picture1 through picture 25.

what want check these variables once pulled database see whether should displayed or not.

currently if there isn't images still shows , missing image sign. , no matter seem write shows regardless off if there image or not, below current code.

   <? if(!isset($picture2) || empty($picture2)){ ?      <div class="property-slide">     <a href="m/properties/<?php echo $row['picture2']; ?>" class="image-popup">     <img alt="" src="m/properties/<?php echo $row['picture2']; ?>"></a>     </div>      <? } ?> 

the value of picture 2 1.jpg located in folder on server @ path m/properties/.

i did consider storing images seperatley, easier use query show relevant properties, pre built else , database populated third party api.


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -