how to show images that I have in a database

0

such friends I ask for your help, I have a table in my database where I save the images and I want to show them on my html page, but when you show them they are arranged horizontally in a row, instead of showing them down

$query = mysqli_query($mysqli, "SELECT n.id_not,n.titulo_not, n.desc_not, p.*  FROM noticias as n INNER JOIN foto as p ON n.id_not=p.id_not WHERE n.id_not='$id'")
                                                    or die('Hubo un error en la consulta : '.mysqli_error($mysqli));

                    while($row=mysqli_fetch_array($query)){

                    if($row['titulo_not']!=$noticia){ 

                    ?>
                    <div class="col-sm-12 col-md-12">
                        <br>
                        <h1 style="font-size: 25px; color:#19396A; font-family: soberana;"><?php echo $row['titulo_not']; ?></h1>
                        <div class="thumbnail">


                        <p style="font-size: 25px; color:#19396A; font-family: soberana;"><?php echo $row['desc_not']; ?></p>


                        <?php

                        $noticia=$row['titulo_not'];

                         } ?>

                          <div class=".col-md-8 " style="display: inline-block; ">

                            <a href="<?php echo $row['ubicacion']; ?>" target="_blank"> <img class="thumbnail img-responsive" id="image" src="<?php echo $row['ubicacion']; ?>" style="  margin:10px; width: 300px; height:230px;" title="<?php echo $row['titulo_not']; ?>"/></a>


                        </div>

                        </div>


                    </div>
                    <?php 

                      }

                     ?>
                </div>
            </div>
    
asked by jeovani 24.08.2018 в 04:14
source

1 answer

0

Bienvenida Jeovani, It seems to me that you are using bootstrap, try changing the classes of your tag div father How you have it is like this

<div class="col-sm-12 col-md-12">

How it should be is like this

<div class="col-sm-12 col-md-4">

This way in devices from tablets onwards you will see three images per row if you change to col-md-3 you will see 4 per row.

I recommend that you do it so col-sm-12 only sees one image per row in embedded devices, it is more comfortable to look at.

    
answered by 24.08.2018 в 05:21