ho questo script
<?PHP
$word=trim($_GET['parola']);
$word1=trim($_GET['parola1']);
$word2=trim($_GET['parola2']);
$conn=odbc_connect("usato",'','') or die(odbc_error());
$query="SELECT * FROM usato where lCODMAR = $word AND lKMPERCI <= $word1 AND sPERIMM >= '$word2'";
$res=odbc_exec($conn,$query) or die (odbc_error());
while (odbc_fetch_row($res)) {
$codice=odbc_result($res,'lCODMAR');
$Imm=odbc_result($res,'sPERIMM');
$id=odbc_result($res,'dDATIMM');
$nome=odbc_result($res,'SMMA');
$cognome=odbc_result($res,'lKMPERCI');
$disp=odbc_result($res,'sDISVEN');
$rep=odbc_result($res,'dbPREVENE');
$prezzo_number = number_format($rep, 2, ',', '');
echo '<table cellspacing="0" cellpadding="0" align=center width=100% height=170 valign=MIDDLE>';
echo '<tr>';
echo '<td valign=middle align=center width=70% height=170 background="sottodesc.jpg">';
print "
<font face=arial, verdana color=#003366 size=3>$nome</font>
";
print "Periodo Immatricolazione : Anno $Imm
";
print "Km Indicati: Km.$cognome
";
print "Disponibilità : $disp";
print "<div align=right><font face=arial, verdana color=#003366 size=3>€. $prezzo_number</font> </div>
";
$foto=odbc_result($res,'sFOTO1');
echo '<td valign=middle align=center width=30% height=170 background="sottogif.jpg">';
print "<img src=$foto width=220 height=160>";
echo '</td>';
echo '</tr>';
}
odbc_close($conn);
?>
quando il campo foto è vuoto vorrei che mi restituisse un messaggio in cui dice "foto nn disponibile" ho provato cn un istruzione If ma mi da sempre un errore..
suggerimenti?