Buonasera a tutti, devo visualizzare alcune immagine contenute in un database,
utilizzo questo codice:

<?php

include("../inclusioni/conf.php");
include_once("paging.php");

$res = paging("SELECT * FROM utenti WHERE sub_categoria='arredamento'");

if (!$res[0]) { echo " <table border=\"0\" width=\"100%\" cellspacing=\"1\" cellpadding=\"0\" align=\"center\">
</tr><span class='fontnero'>
[b]Attenzione area in aggiornamento</strong</span>

"; }
else
{
echo "

<table border=\"0\" width=\"100%\" cellspacing=\"1\" cellpadding=\"0\">

";
while($dati = mysql_fetch_array($res[0])) {


$od = $dati ["od"];
$ragione = $dati ["ragione"];


echo "
<tr>
<td width=\"100%\" class=\"fontnero\">[*]Ragione Sociale : $ragione</td>

</tr>
<tr>
<td width=\"100%\" class=\"font12\" align='right'>
<table border=\"0\" width=\"100%\" cellspacing=\"1\" cellpadding=\"5\" align==\"right\" >
<tr bgcolor=\"#ffffff\">
<td width=\"50%\" valign=\"top\"><img src =\"mostra_logo.php?od=$dati[od]\" border=\"0\"></td></td>


</tr>
</table>

";
<tr>
<td width=\"100%\" class=\"font12\" align='center' valign=\"middle\">
<table border=\"0\" width=\"100%\" cellspacing=\"1\" cellpadding=\"5\" valign=\"middle\" align==\"center\" >
<tr bgcolor=\"#ffffff\">
<td width=\"100%\" valign=\"middle\" align=\"left\"></td>
</td>


</tr>
</table>

";
echo "
<tr bgcolor=\"#ffffff\">
<td width=\"70%\" class=\"grigio12\"height=\"1\" bgcolor=\"#cccccc\"></td>

</tr> ";

}
}
echo "</table>";




l'immagine la recupero da mostra_logo.php


codice:
<?php
include("../inclusioni/conf.php");

mysql_connect($dbhost, $dbuser, $dbpass)
or die('Connessione non riuscita: ' . mysql_error());

if(!mysql_select_db($db))
die('Selezione database fallita!');

$query = 'SELECT Type, DatiBinari, Size FROM utenti WHERE od = '.$_GET['od'];
$risultato = mysql_query($query) or die('Query non valida: ' . mysql_error());
$tmp = mysql_fetch_array($risultato);



header('Content-Type: '.$tmp['Type']);
echo($tmp['DatiBinari']);


?>


Funziona tutto correttamente, il problema consiste nel fatto che la query risulta essere molto lenta.
grazie.