Ho provato così
Codice PHP:
<?php require_once('Connections/temp.php'); ?>
<?php
mysql_select_db($database_temp, $temp);
$sql = "SELECT id,nome, abitante,eta,citta FROM italia";
$result= mysql_query($sql) or die(mysql_error());
$row = mysql_fetch_assoc($result);
?>
<html>
<head>
</head>
<body>
<?php while($row = mysql_fetch_assoc($result)){
$citta=addslashes($row['citta']);
mysql_select_db($database_temp, $temp);
$sql2 = "SELECT id,nome, abitante,eta,citta FROM italia WHERE citta ='$citta' and eta='55' ORDER BY citta limit 10 ";
$result2 = mysql_query($sql2) or die(mysql_error());
$row2 = mysql_fetch_assoc($result2);
}?>
<table width="140">
<?php do { ?>
<tr>
<td> <?php echo $row2['nome']; ?></td>
<td> <?php echo $row2 ['abitante']; ?></td>
<td> <?php echo $row2 ['eta']; ?></td>
<td> <?php echo $row2 ['citta']; ?></td>
</tr>
<?php } while ($row2 = mysql_fetch_assoc($result2)); ?>
</table>
</body>
</html>
non da errore ma non stampa e la query è lenta.