• 20-05-2020, 22:34:42
    #1
    Merhaba veritabanından cektiğim verileri tek tek yan yana sıralayabiliyorum fakat ben o id ye ait ürünleri alt alta sıralamak istiyorum bunu nasıl yapabilirim?
    VERİTABANI

    ŞUAN OLAN DURUM

    bu şekilde yapmak istiyorum photoshopdan basite yapıldı anlatılmak istenen resimlerin tabloda alt alta sıralanması sadece o ürünün resimleri bu sıraya gecicek

                        <table id="datatable1" class="table table-striped dt-responsive nowrap table-hover">
                            <thead>
                                <tr>
                                    <th class="text-left">
                                        <strong>Resim 1</strong>
                                    </th>
                                    <th class="text-left">
                                        <strong>Resim 2</strong>
                                    </th>
                                    <th class="text-left">
                                        <strong>Resim 3</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 { ?>
                                        
    
                                        <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>
                                        
                                        
                                        <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>
  • 20-05-2020, 22:35:50
    #2
    düz html atarmısın
  • 20-05-2020, 22:39:38
    #3
    Bu phplik degil hocam html ile işi çozeceksiniz sizin html o alan verileri yan yana olarak yapmiş html kismi liste halinde alt alta listeletecek ama bunun için class'in css kodunu gormek lazim
  • 20-05-2020, 22:40:44
    #4
    Üyeliği durduruldu
    <br> Kullanabilirsiniz satır atlamak için.
  • 20-05-2020, 22:41:38
    #5
    TufanKeles adlı üyeden alıntı: mesajı görüntüle
    düz html atarmısın
    özelden gönderdim.



    jetbayim adlı üyeden alıntı: mesajı görüntüle
    <br> Kullanabilirsiniz satır atlamak için.
    satır atlamayacagım ikinci resmi yeni ürün gibi alt satıra almak istiyorum
  • 20-05-2020, 22:42:33
    #6
    while içinde sadece td kullanmışsın tr de kullanırsan alt alta ekler bir de thead içinde resim1 resim2 yazmuşsın ya sadece 1 tane head koy
  • 20-05-2020, 22:42:48
    #7
    Üyeliği durduruldu
    Aşağıdaki gibi denermisin.


    <table id="datatable1" class="table table-striped dt-responsive nowrap table-hover">
    <thead>
    <tr>
    <th class="text-left">
    <strong>Resim 1</strong>
    </th>
    <th class="text-left">
    <strong>Resim 2</strong>
    </th>
    <th class="text-left">
    <strong>Resim 3</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 { ?>


    <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>


    <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>
    </br>

    <?php } } ?>
    </tbody>
    </table>
  • 20-05-2020, 22:44:34
    #8
    <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>
  • 20-05-2020, 22:48:21
    #9
    ByMchts adlı üyeden alıntı: mesajı görüntüle
    while içinde sadece td kullanmışsın tr de kullanırsan alt alta ekler bir de thead içinde resim1 resim2 yazmuşsın ya sadece 1 tane head koy
    yine yan yana oluyor efendim, teşekkürler.



    ahmet007 adlı üyeden alıntı: mesajı görüntüle
    Aşağıdaki gibi denermisin.


    <table id="datatable1" class="table table-striped dt-responsive nowrap table-hover">
    <thead>
    <tr>
    <th class="text-left">
    <strong>Resim 1</strong>
    </th>
    <th class="text-left">
    <strong>Resim 2</strong>
    </th>
    <th class="text-left">
    <strong>Resim 3</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 { ?>


    <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>


    <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>
    </br>

    <?php } } ?>
    </tbody>
    </table>
    yan yana oluyor efendim, teşekkürler.