<?php
include "header.php";
require 'conexion.php';
?>
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="utf-8">
<meta name="decription" content="etiquetas html5">
</head>
<div class="shoes-grid">
<div class="products">
<h5 class="latest-product">Listado de Productos</h5>
</div>
<div class="product-left">
<?php
$link = mysqli_connect ('localhost', 'root', '', 'catalogo');
$sql = 'SELECT p.idProducto, p.prdNombre, p.prdPrecio, m.mkNombre, c.catNombre, p.prdPresentacion, p.prdStock, p.prdImagen
FROM productos AS p
INNER JOIN marcas AS m
ON m.idMarca = p.idMarca
INNER JOIN categorias AS c
ON c.idCategoria = p.idCategoria
ORDER BY idProducto';
$resultado = mysqli_query($link, $sql) or die( mysqli_error($link) );
mysqli_close($link);
while ( $fila = mysqli_fetch_array( $resultado ) ){
?>
<div class="col-sm-4 col-md-4 chain-grid">
<a href="?page=producto"><img src="images/productos/<?php echo $fila['prdImagen']; ?>" class="img-responsive"></a>
<div class="grid-chain-bottom">
<h6><a href="#"><?php echo $fila['prdNombre']; ?></a></h6>
<h6><a href="?page=producto">Presentacion:<?php echo $fila['prdPresentacion']; ?></a></h6>
<div class="star-price">
<div class="dolor-grid">
<span class="actual">Precio:<?php echo $fila['prdPrecio']; ?></span>
<br>
<span class="actual">Stock:<?php echo $fila['prdStock']; ?> </span>
</div>
<a class="now-get get-cart" href="?page=producto">VER MÁS</a>
<div class="clearfix"></div>
</div>
</div>
</div>
<?php
}
?>
<div class="clearfix"></div>
</div>
<div class="clearfix"> </div>
</div>
</html>
<div class="col-md-8">
<?php include "footer.php"; ?>
* the code I have shows the divs correctly, (with all the information in the database) but the position is the problem, it only shows two divs in a row, and leaves an empty space on the right side, then on the other row the same always showing only two divs to finish, I'm using bootstrap for the structure, but I do not know if I could fix it like this or just with a CSS sheet