Non l'ho testato... Prova!!

<?php
require_once('Connections/programma.php');
mysql_select_db($database_programma, $programma);
$query_Recordset1 = "SELECT * FROM camere";
$Recordset1 = mysql_query($query_Recordset1, $programma) or die(mysql_error());

for($i=0;$i<=4;$i++){
if(mysql_result($Recordset1,0,stato)=="y"){
$img[$i]="[img]libero.jpg[/img]";
}else{
$img[$i]="[img]ocupp.jpg[/img]";
}

$id[$i]=mysql_result($Recordset1,$i,id);
}
?>

<form id="form1" name="form1" method="post" action="">
<table border="1" width="323" height="127">
<tr>
<td width="20%"><?echo $img[0];?></td>
<td width="20%"><?echo $img[1];?></td>
<td width="20%"><?echo $img[2];?></td>
<td width="20%"><?echo $img[3];?></td>
<td width="20%"><?echo $img[4];?></td>
</tr>
<tr>
<td width="20%"><?echo $id[0];?></td>
<td width="20%"><?echo $id[1];?></td>
<td width="20%"><?echo $id[2];?></td>
<td width="20%"><?echo $id[3];?></td>
<td width="20%"><?echo $id[4];?></td>
</tr>
</table>
</form>


Ciaooo!!!