<table id="datatable1" class="table table-striped dt-responsive nowrap table-hover">
    <thead>
        <tr>
            <th class="text-left">
                <strong>Resim</strong>
            </th>
        </tr>
    </thead>
    <tbody>
            <?php
            $resimsor=$db->prepare("SELECT * from resim where resim_urun=:resim_id");
            $resimsor->execute(array(
                'resim_id' => $urunwrite['urun_id']
            ));
            $say=$resimsor->rowCount();
 
            while ($resimcek=$resimsor->fetch(PDO::FETCH_ASSOC)) {
                if ($say=='0') { ?>                                
                <?php } else { ?>
                 
 
                <tr><td><a href="#" data-toggle="modal" data-target="#textModal<?php echo $resimcek['resim_id']; ?>"><img style="max-width: 400px; max-height: 1000px;" src="<?php echo $resimcek['resim_link']; ?>" alt=""></a></td></tr>
                 
                 
                <div class="modal fade bs-example-modal-lg" id="textModal<?php echo $resimcek['resim_id']; ?>" tabindex="-1" role="dialog" aria-labelledby="textModal">
                 
                    <div class="modal-dialog modal-lg" role="document">
                        <div class="modal-content">
                            <div class="modal-body">
                                <p>
                                    <img style="max-width: 99%; max-height: 900px;" src="<?php echo $resimcek['resim_link']; ?>">
                                </p>
                            </div>
                        </div>
                    </div>
                </div>
 
                <?php } } ?>
        </tbody>
</table>