show all the records except the one I am looking for

0

How I do not show this record but the others. Until there is left.

<?php
    include "codigo/conexion.php";
    $buscar = $_GET['producto']; 
    $consulta = "SELECT * FROM catalogo where idcat = ".$buscar."";
    $resultado = $conexion->query($consulta);
    while($row = mysqli_fetch_array($resultado)){
    $imagenes = $row['imagencat'];  
    ?>
    <img class="d-block img-thumbnail" src="<?php echo $imagenes ?>" >
    <?php } ?>

    
asked by Lucas Cardemil Villegas 11.11.2017 в 00:01
source

1 answer

0

If you want to show all the products except for the one you pass with the $ _ GET , you must make a denial using the exclamation symbol ! to filter for results whose id is different from $ search , this way.

$consulta = "SELECT * FROM catalogo where idcat != ".$buscar."";
    
answered by 11.11.2017 / 00:07
source