PHP - Display BD MySQL Images

0

I want to display the images that are stored in the MySql database, I'm only able to bring 1 image! But in fact I want to display all the image ... I ran this query, which is the query I'm doing in the project.

   WHERE WHERE / em> = 'NWE'

and it returns me 22 results

I'm doing it this way:

index.php

<!DOCTYPE html>
<html>
<head>
    <title>Upload Imagem</title>
</head>
<body>
    <img src="foto.php?CLIE_Logomarca=$codigo" width=120 height=120>
</body>
</html>

foto.php

<?php
    $conn = mysql_connect("localhost", "root", "");
    mysql_select_db('bisaweb_registrador');

    $sql = "SELECT CLIE_Codigo, CLIE_Logomarca FROM acrwregistrador WHERE SIST_Codigo = 'NWE'";
    $dados = mysql_query($sql) or die (mysql_error());
    $linha = mysql_fetch_array($dados);

    $foto = $linha["CLIE_Logomarca"];   
    header("Content-type: image");
    echo $foto;
?>
    
asked by anonymous 07.07.2016 / 16:00

1 answer

1

The code of the photo should bring only one, in the index you do a search and go through all the photos by calling several times the photo.php with a search that brings only a photo.

    
07.07.2016 / 16:47