si....

codice:
<? 
$connection= mysql_connect("xxxxxx","xxxxxx","xxxxxxxxx");
$db=mysql_select_db("xxx",$connection);
$query= "SELECT * FROM articoli ORDER BY id DESC LIMIT 0,5";
$result= mysql_query($query)
or die ("query failed: " . mysql_error());
while($row= mysql_fetch_array($result))
{
$larghezza = "90"; 
echo "<h4> inserito il $row[data] alle ore $row[ora]</h4>"; 
echo "<h2>$row[titolo]</h2>"; 
$articolo_frazionato = substr($row[articolo],0, 500 ); 
$spazio = count(scandir("foto_articoli/".$titolo."/")); 
if( $spazio > 2) 
{ 
    echo "<img src=\"$row[foto]\" width=\" $larghezza\"/>"; 
} 
echo "

$articolo_frazionato"."...

"; 
echo "<p align=\"right\"><a href=\"articolo.php?id=$row[id]\">vai all'articolo</a></p>";

 echo "<hr>

";
 }
 mysql_close($connection);
?>