Home » Php » i want to hide image div having no images using php

i want to hide image div having no images using php

Posted by: admin October 20, 2018 Leave a comment

Questions:

I want to hide my html div when there are no images, and show it when I have an image. How can I do this using php?
this is my code

<?php
   $imgsql=mysqli_query($link,"select eve_pic,eve_pic2,eve_pic3,eve_pic4 from event_tbl");

?>
                <div class="col-md-3 col-sm-6 col-xs-12" <?php  if(mysqli_num_rows($imgsql)>0){ 
                      $imgrow=mysqli_fetch_array($imgsql);
               ?> style="visibility:visible;"<?php }?> <?php else { ?> style="display:none" <?php}?> >
                    <div class=sz_portfolio_003_trig_wrap>
                              <div class=sz_portfolio_003_trig_img>
                        <div class=sz_portfolio_003_trig_btn>
                                 <a href=#sz_portfolio_003_4_col data-backdrop=true data-slide-to=0 data-toggle=modal>
                            <img src="admin/uploads/eventpics/<?php echo $imgrow['eve_pic'];?>" alt="sz_portfolio_003_01" width="200px" height="200px" class="imagen"/></a>

                            </div>
                        </div>

                    </div>
                </div> 
Answers: