<?php 
$after_before_sql =mysqli_query($dbconn,"select * from beforAfter_tbl ORDER BY RAND() limit 3");
if(mysqli_num_rows($after_before_sql)>'0') {
?>
<section class="realted_bf_sec">
            <div class="container">
                <div class="row">
                    <h2 class="catTitle_2">Before & After Treatment Results</h2>
<?php while($after_before_res=mysqli_fetch_assoc($after_before_sql)){ 
    $imglink_before= getImage($after_before_res[gallery_image], 376, 376, $after_before_res[gallery_title],"/uploaded-files/before-after/");?>
                    <div class="col-xxl-4 col-xl-4 col-lg-4 col-md-4 col-sm-6 col-12">
                        <div class="gallery_item">
                            <a class="hover_effect h_yellow" data-fancybox="photo-gallery" href="<?=site_url;?>/uploaded-files/before-after/<?=$after_before_res['gallery_image'];?>">
                                <img src="<?= $imglink_before;?>" alt="<?=$after_before_res['gallery_title'];?>" title="<?=$after_before_res['gallery_title'];?>">
                            </a>
                        </div>
                        <div class="related_bf_title">
                            <p><?=$after_before_res['gallery_title'];?></p>
                        </div>
                    </div>
<?php } ?>



                   
                </div>
                <a href="<?=site_url;?>/before-after-gallery.htm" class="read_more_1 bg_btn_1" title="View
                                More">View
                                More<span></span><span></span><span></span><span></span></a>
            </div>
        </section>
        <?php } ?>
        <div class="clear"></div>